There are 3 steps required to get an API key
- Sign up to findaport.com
- Email us to request your account be upgraded to include access to the API
- Once we have upgraded your account, you can apply for an API Key
The API Key
The API Key is a string of 30 characters, and looks like "de42a32a48b80678837ba605b258f2"
It is used in the querystring in each API call and is a mandatory parameter:
https://www.findaport.com/api/port/20.html?key=de42a32a48b80678837ba605b258f2
Test your API key
Click this link to try to return some summary information about the port of Aabenraa in Denmark. It should try to open this link:
- https://www.findaport.com/api/port/1/summary.xml?key=
At first, the link will return no information. You need to add your API key to the end of the URL in the address bar to correctly form the API request. For example, if your API key is "0123456789abcdefg" then the address for the API call would be:
- https://www.findaport.com/api/port/1/summary.xml?key=0123456789abcdefg
You should see output like this in your browser:
|
Security
The API key gives access to the API for anyone using it. You should take steps to ensure that the key cannot be read in plain text in javascript, php or other code files.
Error codes
A failure to authenticate, usually because the key string is incorrect, will raise an error.
Other errors, all of which your code should detect and manage, are documented in Error Codes.
==> Next: Download sample applications