Skip to main content

API Key Authentication

All Data Docked API requests require authentication using an API key. Pass your API key in the x-api-key header with every request.
curl -X GET "https://datadocked.com/api/vessels_operations/get-vessel-location?imo_or_mmsi=9247431" \
  -H "x-api-key: YOUR_API_KEY"

Getting Your API Key

1

Create an account

2

Navigate to API Keys

Go to your dashboard and find the API Keys section
3

Copy your key

Copy your API key and store it securely

Best Practices

Never expose your API key in client-side code or public repositories.

Keep Your Key Secure

  • Store API keys in environment variables
  • Use server-side code to make API requests
  • Never commit API keys to version control
  • Rotate keys if you suspect they’ve been compromised

Environment Variables

export DATADOCKED_API_KEY="your_api_key_here"

Authentication Errors

If your API key is invalid or missing, you’ll receive a 401 Unauthorized response:
{
  "error": "Unauthorized",
  "message": "Invalid or missing API key"
}

Common Issues

ErrorCauseSolution
Missing API keyNo x-api-key headerAdd the header to your request
Invalid API keyIncorrect key valueCheck for typos or use the correct key
Expired keyKey has been revokedGenerate a new key in your dashboard