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.
1 credits/call
Pricing
1 credits/call
| Condition | Charge |
|---|---|
| Each call | 1 credits/call |
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
q | string | Yes | string or lat,lng to be geocoded | — |
abbrv | boolean | No | when true we attempt to abbreviate the formatted field of results. | false |
jsonp | string | No | wraps the returned JSON with a function name. | — |
limit | integer | No | maximum number of results to return. Default is 10. Maximum is 100. | 10 |
bounds | string | No | four coordinate points forming the south-west and north-east corners of a bounding box | — |
pretty | boolean | No | when true results are pretty printed | false |
language | string | No | an IETF format language code or "native" | — |
roadinfo | boolean | No | when true we geocode to nearest road, include roadinfo annotation | false |
no_dedupe | boolean | No | when true results are not deduplicated | false |
no_record | boolean | No | when true query content is not logged | false |
proximity | string | No | lat,lng to bias results | — |
add_request | boolean | No | if true the request is included in the response. | false |
countrycode | string | No | CSV list of lowercase two letter ISO 3166-1 Alpha 2 codes to limit results to that country/countries. | — |
address_only | boolean | No | when true we include only address details in the formatted field of results. | false |
no_annotations | enum (0 | 1) | No | Set 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-KeyRequest 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
{
"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.


