OpenCage Get JSON

1 credits/call
ae_opencage_get_json

Search for locations by name or coordinates using OpenCage and return the results in JSON format.

Maps
1 credits/call

Pricing

1 credits/call
ConditionCharge
Each call1 credits/call

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
qstringYesstring or lat,lng to be geocoded—
abbrvbooleanNowhen true we attempt to abbreviate the formatted field of results.false
jsonpstringNowraps the returned JSON with a function name.—
limitintegerNomaximum number of results to return. Default is 10. Maximum is 100.10
boundsstringNofour coordinate points forming the south-west and north-east corners of a bounding box—
prettybooleanNowhen true results are pretty printedfalse
languagestringNoan IETF format language code or "native"—
roadinfobooleanNowhen true we geocode to nearest road, include roadinfo annotationfalse
no_dedupebooleanNowhen true results are not deduplicatedfalse
no_recordbooleanNowhen true query content is not loggedfalse
proximitystringNolat,lng to bias results—
add_requestbooleanNoif true the request is included in the response.false
countrycodestringNoCSV list of lowercase two letter ISO 3166-1 Alpha 2 codes to limit results to that country/countries.—
address_onlybooleanNowhen true we include only address details in the formatted field of results.false
no_annotationsenum (0 | 1)NoSet to "1" to omit annotations from results, or "0" to include them.0

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_opencage_get_json' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "abbrv": false,
    "add_request": false,
    "address_only": false,
    "limit": 10,
    "no_annotations": "0",
    "no_dedupe": false,
    "no_record": false,
    "pretty": false,
    "q": "52.5432379, 13.4142133",
    "roadinfo": false
  }
}'
Response exampleresponse.json
JSONPartial content
{
  "documentation": "https://opencagedata.com/api",
  "licenses": [
    {
      "name": "see attribution guide",
      "url": "https://opencagedata.com/credits"
    }
  ],
  "results": [],
  "status": {
    "code": 400,
    "message": "Value \"false\" did not pass type constraint \"Int\""
  },
  "stay_informed": {
    "blog": "https://blog.opencagedata.com",
    "mastodon": "https://en.osm.town/@opencage"
  },
  "thanks": "For using an OpenCage API"
}

This example shows part of the response. Copied content is valid JSON.