buildError

Returns an {Error} object with response and status

buildError
Parameters
code (any)
message (any)

buildQuery

Builds the query params including key and proxy URL

buildQuery
Parameters
input (any)

geocode

geocode address and reverse geocode coordinates using OpenCage API requesting the json format.

geocode
Parameters
input (Object) the input query parameter as JSON object, the attribute q is required, the key can be omitted when using a proxyURL , and when using node with a dedicated environment variable (OPENCAGE_API_KEY). Others optional paameters can be found at Opencage Data API documentation
Returns
Promise: a promise resolved by the json format API payload