Use your API Key to authenticate with all Nearmap's HTTP-based services: WMS, WMTS, TMS and Image API.
The API Key must be sent with every request to the service. The API key can be sent with the request using the apikey URL parameter or an HTTP Authorization header.
Using API Key in a URL
Include the apikey=YOUR_API_KEY name/value pair in the URL (replacing "YOUR_API_KEY" with the sequence of characters that make up your API Key).
Here are example URL formats using API Key for our WMS and TMS services, both for Australia and the US:
WMS
- Australia & New Zealand:
https://wms.nearmap.com/wms?REQUEST=GetCapabilities&apikey=YOUR_API_KEY
- US:
https://wmsus.nearmap.com/wms?REQUEST=GetCapabilities&apikey=YOUR_API_KEY
Tile API
- All areas:
https://api.nearmap.com/tiles/v3/Vert/21/1855981/1265938.jpg?apikey=YOUR_API_KEY
TMS
- Australia & New Zealand:
https://au0.nearmap.com/maps?x=120591&y=78650&z=17&nml=Vert&version=2&httpauth=false&apikey=YOUR_API_KEY
- US:
https://us0.nearmap.com/maps?x=59899&y=107922&z=18&nml=Vert&version=2&httpauth=false&apikey=YOUR_API_KEY
See our Tile API, WMS, and TMS documentation for further examples for each of our APIs.
See our GIS and CAD Integration pages for specific instructions for various third-party GIS applications.
Using API Key in an HTTP Authorization Header
The API Key can be presented in an HTTP Authorization header. The format of the header is as follows:
Authorization: Apikey YOUR_API_KEY
The case of the authorization type is significant: the string must be "Apikey" with a capital A and all other characters lowercase.
Here are examples of cURL commands for our TMS API:
- Australia & New Zealand:
curl -vvv -H'Authorization:Apikey YOUR_API_KEY' ' http://au0.nearmap.com/maps?x=120591&y=78650&z=17&nml=Vert&version=2&httpauth=false'
- US:
curl -vvv -H'Authorization:Apikey YOUR_API_KEY' ' http://us0.nearmap.com/maps?x=59899&y=107922&z=18&nml=Vert&version=2&httpauth=false'