Your questions about OpenCage, answered.
What is geocoding?
Geocoding turns geographic coordinates (latitude and longitude) into a geographic reference - such as an address, a place name, or locality - or vice versa. The good folks at Wikipedia explain this far better than we can.
Do you do forward geocoding?
Yes, with our API you can do "forward geocoding" which is the process of turning an address or place name into coordinates.
What about reverse geocoding?
Yes, we can gladly also do "reverse geocoding" which means turning coordinates into a human understandable place name or address. Just pass the coordinates as a latitude and a longitude, separated by either a comma or a (URL encoded) space and the API will automagically work out that you want to reverse geocode. Here's an example:
https://api.opencagedata.com/geocode/v1/json?q=51.4277844+-0.3336517&pretty=1&key=YOUR-API-KEYIf you'd like to learn more about reverse geocoding you may find our comprehensive guide to reverse geocoding useful.
Do you make maps?
Do you provide routing?
Do you provide a "snap to road" API?
Our API accepts only a single location (pair of coordinates)
per request, we do not accept tracks or a series of points.
We do allow you to geocode to the nearest road by using
Please see the relevant
details in the API documentation.
Do you provide a "location autosuggest" for search forms?
Do you provide IP address to location (often called "geoip" or "ip2location")?
Can I use OpenCage to determine the location of someone visiting my website?
That's a process known as browser geolocation, it's a different concept than geocoding. We have a detailed guide to browser geolocation and how to use it in combination with geocoding.
Do you support more than one query (location) per request (sometimes known as “batch geocoding” or "bulk geocoding")?
What countries can you geocode for?
All of them; there's worldwide, global coverage. But it will vary from country to country, and even within countries. Coverage will depend on the data sources we use. At a minimum we're as good as OpenStreetMap is, and OpenStreetMap is continually improving at the rate of many millions of edits per day (thanks OSM volunteers!).
What's behind the geocoder API?
Other geocoders and lots and lots of open data.
Some well known opensource geocoders that we use are Nominatim, Data Science Toolkit and the Two Fishes geocoder, but there are also others.
All of this is built on open geospatial data including OpenStreetMap, Yahoo! GeoPlanet, Natural Earth Data, Thematic Mapping, Ordnance Survey OpenSpace, Statistics New Zealand, Zillow, MaxMind, GeoNames, the US Census Bureau and Flickr's shapefiles plus a whole lot more besides. Here's the full list of datasources.
So why shouldn't I just use those opensource geocoders directly?
A few reasons.
First up, hosting your own software and keeping it up to date (and keeping the underlying data up to date) can be a non-trivial technical challenge. It will cost you time and effort. If that type of opsy problem is your thing, go for it. Or you can just let us handle it, and instead get on with geocoding.
There are other hosted open geocoding services, most obviously OpenStreetMap's own Nominatim service. However that is designed to be used as a tool by mappers, not as an enterprise level geocoding service, and indeed the usage policy explicitly says it "has a very limited capacity" and users may be blocked if requesting too frequently.
Finally, you can feel good about the fact that we're regularly sponsoring open geo events (we run the geo meetup Geomob), contributing code back to the major OSM software projects, opensource many of our own projects (pls send patches!), and are corporate members of the OpenStreetMap Foundation.
I'm already using Google's geocoding API, why should I switch to the OpenCage geocoding API?
Please see our full overview of migrating from Google Maps geocoding, which goes into more detail on the exact differences between the services.
That said, there is no requirement that you use only our service. Many people use our service AND other services like Google. This typically works out to be more cost effective than just using an expensive service like Google.
Will you add more geocoders in the future?
Yes, we regularly add more geocoders, typically country-specific geocoders. Please get in touch if you have a specific suggestion.
How are the results ordered?
Results are ordered from most relevant to least. Please see details of ranking on the API page.
How frequently is the underlying data updated?
We're currently updating from OpenStreetMap daily. Our experiments have shown that more frequent updates are not very useful as they lead to a hit on database speed. OpenStreetMap averages several million edits per day.
Does the API return exact boundaries or polygons for areas?
No. When possible we return a bounding box (which we use to calculate the result's confidence score). There are a few reasons we don't return polygons. First of all, we aggregate many different geocoders, and while some have some polygons in their underlying data, some do not, or have only partial coverage. Secondly, polygons can be absolutely massive in terms of data size.
Can I use the API behind a firewall, or in software that requires users to register?
Yes. You can use our API for public and private projects.
Can I use the API in desktop software?
Yes. Your software does not need to be publicly visible on the web.
Can I use the API in closed-source software?
Can I use the API in Google Docs or Excel?
If your spreadsheet is a bit more complex, or you just prefer to let someone else handle it we recommend you talk with our friends at Clean Spreadsheets, who are experts at data cleaning and can do the geocoding using our service for you.
The results you're giving me are wrong; have I found a bug?
It's possible. You might have found a bug in the API, but you might also have found a hole in the underlying data. Let us know ( via our contact form), and we'll figure out what the problem is. if possible please include the exact query you made, including all optional parameters. It will help us answer you more quickly.
We're continually working on making it much easier to feed corrections back to us, and of course back to OpenStreetMap. Here's a tutorial covering how to add an address to OpenStreetMap.
I always call it OpenStreetMaps (with s), am I wrong?
Sorry, but yes, you are wrong.
Who makes OpenCage?
Peek behind the curtain over on our about us page.
Account Management issues
Can I change my account email address?
Yes, in your account dashboard you can change your email address at any time. You will just need to confirm the new address by clicking on a link in the confirmation email we send you.
Can I give someone else in my team access to the account?
Anyone can use your API key, all they need is the key. Subscription customers can create multiple API keys and can assign the API keys labels in their account dashboard, for example "testing", "dev", "production", etc.
Each account is tied to one email address, we do not have any sort of limited account access, or administrator role. If you want to make access available to a team the simplest way to do that is by using a generic email address.
Can I have invoices and billing related emails go to a different email address?
Yes. Customers can specify an email address for all billing related matters in their account dashboard.
Can I set up two factor authentication (2FA) for my account?
What output formats does the geocoding API support?
You specify which format you want in the URL you request. We support JSON (and jsonp) because it's (mostly) easy for humans to read and easy for applications to parse. Some people like XML or GeoJSON, we support those too. We also support Google's JSON response format if you want a drop in replacement - see details.
How should I format the address when forward geocoding?
Great question. There is a lot that you can do to make it easier for us to find the correct result. Please see our detailed guide to forward geocoding query formatting.
Do you support Google's request or response format?
Yes, by using the
output format. At a
high level swapping from using v3 of Google's geocoder is as
simple as changing the URL of a geocoding request from using
That said, we really recommend you use our format, as some aspects of our service are different. Please see our full overview of migrating from Google's geocoding service.
Do you support geocoding over HTTPS?
Yes. Please make all your requests via https. Please note, as a security measure, from 15 September 2020 we will drop support for HTTPS requests using HTTPS TLS 1.0 and 1.1, this was announced on our blog in May 2020.
How many requests can I make per second?
It depends if you are on the free trial or a paying customer. Free trial users are limited to one request per second. Paying customers can go much faster, please see the pricing page for exact numbers.
Are there other technical difference between the free trial and paid accounts?
There is no difference in the quality of the results. We try to answer all queries as quickly and correctly as possible.
Because subscription accounts do not have hard limits, we do not include rate limiting information in the response for paid accounts. In all other respects the results are the same.
Can I have multiple API keys, each with their own reporting?
If you are a subscription customer, yes. If not, no.
Where are the OpenCage servers?
Our servers are at multiple, redundant locations in Germany, hosted with a leading hosting provider: Hetzner. They're great and very well connected from a networking standpoint.
Can I limit use of my key to certain IP addresses?
If you are a subscription customer, yes. If not, no. Details here.
Can I limit use of my key to a specific domain?
Not exactly. Subscription customers can specify a CORS header which will limit AJAX requests to a specific domain. Please see the details in our API documentation.
Will you add servers in region X (where X is whatever your favourite place is)?
Sure, happy to discuss it if you're a large or enterprise subscription customer.
What can I do to get responses more quickly?
Please see our detailed guide to geocoding more quickly.
I don't want to write code to use an API, do you have any ready made libraries or SDKs?
Yes, many, and we're always working on more. They're all open source, please contribute; we're looking forward to your pull requests.
If we don't yet have your programming language of choice, apologies. Feel free to help move things along more quickly by creating your own library which we'll gladly feature. Before you fire up your editor though, please read our our SDK guidelines.
Is there a definitive list of all the possible keys of the
field of the response?
The world is, as you've possibly experienced, a crazy and chaotic place. The great strength of a crowd-sourced project like OpenStreetMap is that it is very flexible, to allow the mapper on the ground to enter whatever he or she needs. The flip side of that is that, as hundreds of thousands of people around the world have been entering data, it can, at times, be a little chaotic.
Nevertheless, best practices have emerged and usually the output is well structured. But unfortunately not always.It's exactly for this reason that we provide a formatted place name. We also provide the
_categorykeys in the
componentslist. In this way you can know what type of thing we matched and what category it belongs to. Please see the API docs to learn more.
The bounding box the Geocoding API is returning seems much to large. Why?
Does the OpenCage geocoding API return some sort of permanent id or identifier for each location?
annotationsportion of the response we do return numerous types of identifiers for that specific location, that you may be able to use as a succinct identifier.
We're looking at other ways to limit access, we know keys alone aren't perfect.
Can I cache the results?
Yes, you can store the results as long as you like. Please see our detailed comments on caching.
Do I have to delete the results after I stop being a customer?
No, you can store the results as long as you like.
When will you have feature X?
It depends. Please get in touch if you think there is a critical feature preventing you from using our service.
Can forward and reverse geocoding results be inconsistent?
Yes. You may notice this if you do a forward query and then plug the resulting coordinates back in to the geocoder you may not end up with your original query. Please keep in mind that behind the scenes we are using many different open geocoders. Some are better for forward geocoding, some for reverse geocoding. Entirely different algorithms may come into play. As a result, there is no guarantee that a "round trip" will work.
How can I see my usage of the geocoding API
In your account dashboard (in the "Usage" tab) we provide charts showing historic usage, you can also access the data used to make the charts as a CSV file via a URL that can be found in your account dashboard.
How much does it cost?
Please see all the details of pricing and free trial on the pricing page.
How does the free trial work?
The free trial tier is limited to 2,500 requests per day. Please see all the rate limiting details. You can use the free trial as long as you like, but please bear in mind that it is designed to be used as a way to test if our service meets your needs. Please do NOT run production services on a free trial. If you want to depend on our service please upgrade to a paid package.
Can you give me uptime guarantees and a service level agreement (SLA)?
For paying customers, yes. But all users should rest assured that we're using the geocoder ourselves. If it's down for you, it'll be down for us too and we'll be trying to fix it. Please follow us on twitter where we'll communicate in the event of any outage.
We use the independent 3rd party service StatusCake to measure uptime of our site and API, please have a look at our recent performance.
Why can't I just register lots of accounts and use them up to the free trial limit as a way to get out of paying anything?
First up, many thanks to all of you that don't do this. By playing within the rules you enable us to work on this service (and the open source software that it runs on). You are awesome.
But assuming you have no moral qualms about abusing our generous service, be warned that when we see you doing this we will start feeding you back randomly wrong results. Enjoy!
I have a one-time data set I need geocoded, I don't want a subscription. Can I still become a customer?
How is OpenCage's pricing different than Google Maps geocoding API pricing?
My requirements are pretty extreme. Hundreds of requests per second, many millions of queries. Can you help me?
Is OpenCage GDPR (General Data Protection Regulation) compliant?
Yes, please see our page about GDPR and data protection.
How do I attribute OpenStreetMap properly?
On your about page or similar page where it can easily be found add "Geodata copyright OpenStreetMap contributors". It should of course be in the language of your service, not necessarily in English.
Learn more about attributing OSM over on the OpenStreetMap wiki. The OpenStreetMap Foundation (of which we're proud to be a corporate member) has released geocoding guidelines in which they make clear that "the share-alike obligations of the ODbL are not triggered" by almost all geocoding cases.
Now that you are using OpenStreetMap data, maybe you're interested in becoming a mapper yourself? If so Learn OSM is a great resource for getting started.
Do I need to attribute OpenCage or just OpenStreetMap?
There is no need to attribute us, it's not our data. Nevertheless if you find our service useful it would be absolutely ace if you told the world. Good karma will flow to you like an unending river, which is always helpful.
Does OpenCage store the query I send to be geocoded?
We're not interested in what you send to us, but as the query is part of the request you send to the API, it'll be stored in our server logs. If something goes wrong, we use the logs to help us work out what went wrong and how to fix it. After six months logs are automatically deleted.
You can use the optional
the full list optional request parameters)
in which case we do not log the query you send to us.
We still record that you made a request, but not the specific
query you made.
Are the OpenCage servers in the EU?
Yes, our hosting is with Hetzner in Germany, in the EU. Our logs never leave Europe.
Can I hold OpenCage liable if I use this data?
No. All data is supplied "as is" and with no warranty. Use common sense.
Can OpenCage sign a HIPAA Business Associate Agreement (BAA) with my business?
Gladly, if you are a paying customer.
That all sounds good, but surely you have really complicated terms and conditions?
No. Please see our terms and conditions. We keep it as simple as possible. Basically, obey all laws, obey the data license, and you can't hold us responsible for the correctness of results. If you abuse the service we may cancel your account. So don't do that.
We look forward to working with you.