OpenCage Geocoder
opencagedata · Location
Worldwide forward and reverse geocoding
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
GET /v{version}/{format}
geocode a query
https://api.apis.guru/v2/specs/opencagedata.com/1/v{version}/{format}?q=test&key=YOUR_API_KEY&abbrv=true&jsonp=example&limit=10&bounds=example&pretty=true&language=en&roadinfo=true&no_dedupe=true&no_record=true&proximity=example&add_request=true&countrycode=example&address_only=true&min_confidence=1&no_annotations=true
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/opencagedata.com/1/v{version}/{format}?q=test&key=YOUR_API_KEY&abbrv=true&jsonp=example&limit=10&bounds=example&pretty=true&language=en&roadinfo=true&no_dedupe=true&no_record=true&proximity=example&add_request=true&countrycode=example&address_only=true&min_confidence=1&no_annotations=true"import requests
params = {
"q": "test",
"key": "YOUR_API_KEY",
"abbrv": "true",
"jsonp": "example",
"limit": "10",
"bounds": "example",
"pretty": "true",
"language": "en",
"roadinfo": "true",
"no_dedupe": "true",
"no_record": "true",
"proximity": "example",
"add_request": "true",
"countrycode": "example",
"address_only": "true",
"min_confidence": "1",
"no_annotations": "true"
}
response = requests.get(
"https://api.apis.guru/v2/specs/opencagedata.com/1/v{version}/{format}",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/opencagedata.com/1/v{version}/{format}');
url.searchParams.set('q', 'test');
url.searchParams.set('key', 'YOUR_API_KEY');
url.searchParams.set('abbrv', 'true');
url.searchParams.set('jsonp', 'example');
url.searchParams.set('limit', '10');
url.searchParams.set('bounds', 'example');
url.searchParams.set('pretty', 'true');
url.searchParams.set('language', 'en');
url.searchParams.set('roadinfo', 'true');
url.searchParams.set('no_dedupe', 'true');
url.searchParams.set('no_record', 'true');
url.searchParams.set('proximity', 'example');
url.searchParams.set('add_request', 'true');
url.searchParams.set('countrycode', 'example');
url.searchParams.set('address_only', 'true');
url.searchParams.set('min_confidence', '1');
url.searchParams.set('no_annotations', 'true');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/opencagedata.com/1/v{version}/{format}")
q := baseURL.Query()
q.Set("q", "test")
q.Set("key", "YOUR_API_KEY")
q.Set("abbrv", "true")
q.Set("jsonp", "example")
q.Set("limit", "10")
q.Set("bounds", "example")
q.Set("pretty", "true")
q.Set("language", "en")
q.Set("roadinfo", "true")
q.Set("no_dedupe", "true")
q.Set("no_record", "true")
q.Set("proximity", "example")
q.Set("add_request", "true")
q.Set("countrycode", "example")
q.Set("address_only", "true")
q.Set("min_confidence", "1")
q.Set("no_annotations", "true")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/opencagedata.com/1/v{version}/{format}")
uri.query = URI.encode_www_form({
"q" => "test",
"key" => "YOUR_API_KEY",
"abbrv" => "true",
"jsonp" => "example",
"limit" => "10",
"bounds" => "example",
"pretty" => "true",
"language" => "en",
"roadinfo" => "true",
"no_dedupe" => "true",
"no_record" => "true",
"proximity" => "example",
"add_request" => "true",
"countrycode" => "example",
"address_only" => "true",
"min_confidence" => "1",
"no_annotations" => "true"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/opencagedata.com/1/v{version}/{format}?" . http_build_query([
"q" => "test",
"key" => "YOUR_API_KEY",
"abbrv" => "true",
"jsonp" => "example",
"limit" => "10",
"bounds" => "example",
"pretty" => "true",
"language" => "en",
"roadinfo" => "true",
"no_dedupe" => "true",
"no_record" => "true",
"proximity" => "example",
"add_request" => "true",
"countrycode" => "example",
"address_only" => "true",
"min_confidence" => "1",
"no_annotations" => "true"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with OpenCage Geocoder?
OpenCage Geocoder is a Location API. Developers commonly use location APIs for:
- tracking assets and vehicles in real time
- building delivery and logistics apps
- finding nearby businesses or services
- geo-fencing and location-based notifications
- address validation and autocomplete
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. OpenCage Geocoder is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide