Frequently Asked Questions

Your questions about OpenCage, answered.

General

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-KEY

If you'd like to learn more about reverse geocoding you may find our comprehensive guide to reverse geocoding useful.

Do you make maps?

No. We focus on doing one thing well - a geocoding API. If you need custom maps, there are many great services out there. We recommend Thunderforest.

Do you provide routing?

No. As above, we focus on doing one thing well - a geocoding API. If you need routing, we recommend having a look at Graphhopper and Verso (who focus on routing optimization). Both are great open-source / open data based companies.

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 the optional roadinfo setting. Please see the relevant details in the API documentation.

Do you provide a "location autosuggest" for search forms?

Yes! We call it Geosearch.

Please see our guide to the differences between geocoding and geosearch.

Do you provide IP address to location (often called "geoip", "ip2location", "IP geolocation")?

No. We focus on doing one thing well: geocoding.

Please see our detailed guide to difference between IP geolocation and geocoding.

Can I use OpenCage to determine the location of someone visiting my website?

No, that's a process known as browser geolocation, it's a different concept than geocoding.

Please see our detailed guide to browser geolocation and how to use it in combination with geocoding.

Can I use OpenCage to determine the location of a mobile phone, just based on the phone number?

No. There are tutorials that phone number parsers (e.g.'phonenumbers' Python library), but they only return the country of the phone number. Please see our blog post about this.

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?

Yes. We support 2FA via authenticator apps like Google Authenticator and Authy You can enable 2FA in the "Account" section of your dashboard.

Can I delete my account?

Yes, you can do so in the "Account" section of your dashboard. If you are a subscription customer you will have to first cancel your subscription.

Please note: inactive accounts are automatically deleted after three months.

Pricing/Billing

How much does using OpenCage services cost?

Please see all the details of pricing and free trial on the pricing page.

How does the geocoding API 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)?

We pride ourselves on our reliability, and target 100% uptime with no scheduled maintenance windows. We use independent, 3rd-party monitoring to measure uptime of our site and API, please have a look at our recent performance.

Please see our annual performance reports. If you have particularly demanding requirements a custom written SLA is available for our enterprise customers.

If in doubt please get in touch, we work with hundreds of customers large and small around the world, and feel confident we can deliver a solution that works for you.

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?

Yes, we also offer one-time plans in various sizes, you can find the details on our pricing page.

If you don't have the technical skills to query the API yourself you may wish to work with our partner Clean Spreadsheets, who will gladly assist you in getting your data processed.

If in doubt, please get in touch with us.

How is OpenCage's pricing different than Google Maps geocoding API pricing?

We are much more affordable and customer-friendly (no surge pricing).

Here's a detailed pricing comparison with numbers.

My requirements are pretty extreme. Hundreds of requests per second, many millions of queries. Can you help me?

Excellent, we have several customers who fall into that category. Please see our Enterprise offering. We look forward to working with you.

Can I hold OpenCage liable if I use data supplied by an OpenCage service?

No. All data is supplied "as is" and with no warranty. Use common sense.

Is OpenCage GDPR (General Data Protection Regulation) compliant?

Is OpenCage HIPAA compliant?

Can OpenCage sign a HIPAA Business Associate Agreement (BAA) with my business?

Gladly, if you are a paying customer. Please see our HIPAA compliance page.

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 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.

Please see the citation section of our branding page for the exact wording you should use.

I need to cite use of OpenCage for an academic paper, how do I do it?

Please see the citation section of our branding page for the exact wording you should use.

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 no_record parameter (see 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.

Please see our page about GDPR, data protection, and privacy.

Are the OpenCage servers in the EU?

Yes, our hosting is with Hetzner in Germany, in the EU. Our logs never leave Europe.

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.

Geocoding API FAQ

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.

Also, we do a lot to enhance the results we send you, adding confidence scoring, annotations, well formatted nice-names.

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.

Here's a detailed overview of how our service compares to Nominatim.

I'm already using Google's geocoding API, why should I switch to the OpenCage geocoding API?

The two main reasons are better terms of use (because we use open data) and significantly lower cost.

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 geocoding API return exact boundaries or polygon for areas?

No. We discuss the reasons why not in the API documentation.

Can I use the geocoding 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 geocoding API in desktop software?

Yes. Your software does not need to be publicly visible on the web.

Can I use the geocoding API in closed-source software?

Yes.

Can I use the geocoding API in Google Docs or Excel?

Yes, please see our tutorial on how to use the geocoder in Google Sheets or in 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.

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 google-v3-json 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 https://maps.googleapis.com/maps/api/geocode/json? to using https://api.opencagedata.com/geocode/v1/google-v3-json?

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.

Some annotations are resource intensive, it isn't viable to have them on by default for everyone, instead they are only available to paying customers and need to be specifically enabled for the customer account.

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 components field of the response?

Unfortunately, no.

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 _type and _category keys in the components list. 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?

Sometimes users of the API are surprised when we return much larger bounding boxes than they expect. Good examples are searches for places like "The United States" or "France". The bounding box we return will include territories like Guam or French Guiana, and thus may be much larger than you expected. This comes up with many countries, but smaller administrative regions can also have exclaves (An example: the German city/state Hamburg includes the Nationalpark Hamburgisches Wattenmeer).

Does the OpenCage geocoding API return some sort of permanent id or identifier for each location?

No, there is no permanent id that represents a specific location across time. This is a result of us aggregating many different geo databases behind our API.

That said, in the annotations portion 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.

I'm nervous about putting my geocoding API key in client side javascript. Won't people steal it?

If you put it out there on the internet, yes, it is certainly possible. Please see our detailed guide to protecting your API key(s). Our recommendation is to have your javascript send requests to your server where you then call our API. In this way the key is never exposed to the world. Here's a tutorial explaining how to run the query to our servers from Google Cloud.

If you are a subscription customer you can turn on IP restriction and specify a CORS header.

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.

Geosearch

Please see the "Common Questions" section of our geosearch page.

Start your free trial

2,500 geocoding API requests per day.

No credit card required.

This image shows the node density of OpenStreetMap data in summer 2015.
It's one of many data sources we use.

Data © OpenStreetMap contributors, Imagery © Martin Raifer, cc-by
Open as larger interactive map
OpenStreetMap node coverage