API Keys are now required

As per the notice just under 1 year ago, API Keys are now expected to be used by any application or service that makes regular use of the API.

Currently this restriction is simply imposed on calls which have a maxresults greater than 250 as we don’t currently have a method for counting ‘regular’ API use otherwise.

To get an API key, sign in to openchargemap.org and browse to ‘my profile > my apps’ and click register an application.

To use your API key include it as the value of the ‘X-API-Key’ header (case sensitive) or key= query string parameter (also case sensitive).

If this is not acceptable for any reason you can run your own API mirror system (or we can arrange for one to be hosted for you commercially). This is the same method we use for our own API load balancing: https://github.com/openchargemap/ocm-system/tree/master/API/OCM.Net/OCM.API.Worker

We have at least 1 user using FME Server trying to download the entire result set for the UK several times per minute. Whoever that is, could they please not, your requests are currently being blocked.

All users are asked to do their utmost to reduce pressure on our API services by caching results or limiting the frequency of requests, as I regularly have to juggle servers being crushed by hostile requests. Currently we have 3 API servers and these are load balanced/proxied using Cloudflare workers. If people are considerate with the way they query the API (and how often they do it) then that reduces the amount of infrastructure we need to manage. While there are many auto scaling solutions available, more scale = more cost.

1 Like

Update: since introducing the API key restrictions we have saved over 40 GB of data transfer per day.

Hello Christopher, this may have been us by accident. One of our workflows weren’t set up on FME server correctly. Please could you unblock our access so we can use the API? We will ensure this does not happen again - apologies!! I have sent an email with our API key for your reference.

Thanks in advance!

Thanks, no, the use case you have is apparently not a good match for our API and was responsible for an unreasonable amount of traffic against our shared API. Instead you should either run your own mirror instance or my company (Webprofusion - email christopher.cook at webprofusion.com) can provide and manage a separate load balanced mirror instance for you. You may also be interested in just regularly cloning our data set: https://github.com/openchargemap/ocm-data