REST Countries v3.1 Lookup by Country Name
Search ISO country metadata by common or official name including ISO-3166 codes, currencies, capital, population, languages, and timezones.
curl -sG "https://api.agentapigate.ai/v1/geo/restcountries/by_name" \ --data-urlencode "name=singapore" \ --data-urlencode "format=md" \ -H "Authorization: Bearer aag_live_YOUR_KEY" \ -H "X-AAG-Max-Cost: 0.0100"
# REST Countries v3.1 Lookup by Country Name (`geo.restcountries.by_name`) **query**: singapore · **count**: 1 ### 1. common: Singapore, official: Republic of Singapore, nativeName: eng: official: Republic of Singapore, common: Singapore, zho: official: 新加坡共和国, common: 新加坡, msa: official: Republik Singapura, common: Singapura, tam: official: சிங்கப்பூர் குடியரசு, common: சிங்கப்பூர் - cca2=SG | cca3=SGP | ccn3=702 | independent=true | unMember=true | currencies=SGD: name: Singapore dollar, symbol: $ | capital=Singapore | region=Asia
Endpoint Parameters, Cost & Token Economy Reference
Endpoint ID:geo.restcountries.by_name · Method: GET| Parameter | Type | Req | Sample / Default | Description |
|---|---|---|---|---|
| name | string | required | singapore | Country common, official, or native name (e.g. "singapore", "germany", "united states") |
| fullText | boolean | optional | false | Require exact full-name match instead of substring match (default false) |
| format | enum | optional | json | compact | md | Response format; compact or md cuts LLM tokens. |
| dry_run | 0 | 1 | optional | 1 | Returns exact pre-flight price quote & validation at $0.00 cost. |
| Access Rail / Metric | Value | Policy & SLA |
|---|---|---|
| API Key (PAYG) | $0.0015 / call | $0/mo · Balance never expires |
| Remote MCP Tool | geo_restcountries_by_name | OAuth 2.1 Hub & /mcp/local |
| x402 Base USDC | $0.0020 / call | Zero-signup USDC enabled |
| P50 Latency | 3972 ms | $0 billed on empty or 4xx/5xx |
| Token Economy | 1228t → 156t (-87%) | Partner credit: eligible |
| Data Attribution | Source: REST Countries Canonical v3.1 Country Reference Dataset (gitlab.com/restcountries/restcountries — MPL-2.0 / Open Data) | |
More geo.restcountries Sibling Endpoints
Frequently Asked Questions
How do I call REST Countries v3.1 Lookup by Country Name (geo.restcountries.by_name) over REST and Remote MCP?
Send GET requests to https://api.agentapigate.ai/v1/geo/restcountries/by_name with an aag_live_* / aag_agent_* Bearer key, pay per call via x402 USDC, or call MCP tool geo_restcountries_by_name on https://mcp.agentapigate.ai/mcp.
What does geo.restcountries.by_name cost per call and are failed calls billed?
Each successful HTTP 200 response costs $0.0015 USD from a non-expiring PAYG balance ($0/month minimum). Upstream errors, empty responses, and ?dry_run=1 pre-flight quotes always bill $0.00.
How does ?format=md or ?format=compact optimize AI agent token usage on geo.restcountries.by_name?
Passing ?format=md transforms the response into normalized Markdown (~156 tokens vs ~1228 raw tokens, saving 87% of LLM context budget) while preserving structured JSON via ?format=json.
Can I restrict an AI agent key to only local endpoints with a daily USD cap?
Yes. Create a scoped aag_agent_* sub-key via POST /v1/keys with allowed_packs: ["local"], optional allowed_endpoints: ["geo.restcountries.by_name"], read_only: true, and a hard daily_cap_usd enforced atomically in Redis.