OpenCage Get JSON
1积分/次
ae_opencage_get_json
使用 OpenCage 按名称或坐标搜索地点,并以 JSON 格式返回结果。
1积分/次
价格说明
1积分/次
| 条件 | 费用 |
|---|---|
| 每次调用 | 1积分/次 |
工具参数
未传入的可选参数将使用平台默认值。
| 参数 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
q | string | 是 | string or lat,lng to be geocoded | — |
abbrv | boolean | 否 | when true we attempt to abbreviate the formatted field of results. | false |
jsonp | string | 否 | wraps the returned JSON with a function name. | — |
limit | integer | 否 | maximum number of results to return. Default is 10. Maximum is 100. | 10 |
bounds | string | 否 | four coordinate points forming the south-west and north-east corners of a bounding box | — |
pretty | boolean | 否 | when true results are pretty printed | false |
language | string | 否 | an IETF format language code or "native" | — |
roadinfo | boolean | 否 | when true we geocode to nearest road, include roadinfo annotation | false |
no_dedupe | boolean | 否 | when true results are not deduplicated | false |
no_record | boolean | 否 | when true query content is not logged | false |
proximity | string | 否 | lat,lng to bias results | — |
add_request | boolean | 否 | if true the request is included in the response. | false |
countrycode | string | 否 | CSV list of lowercase two letter ISO 3166-1 Alpha 2 codes to limit results to that country/countries. | — |
address_only | boolean | 否 | when true we include only address details in the formatted field of results. | false |
no_annotations | enum (0 | 1) | 否 | Set to "1" to omit annotations from results, or "0" to include them. | 0 |
调用示例
查询坐标 52.5432379, 13.4142133 的 OpenCage 地理编码结果(请求因 no_annotations 类型错误返回 400)
POST
/agent-api/v1/tool/executeX-Api-Key请求代码request.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.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"
}返回示例仅展示部分内容,不代表完整响应;复制内容为合法 JSON。


