Drayrates Logo

Resources
Find what you need here

API Getting Started

Learn how to integrate with the Drayrates API to access market rates, generate quotes, and manage your pricing programmatically.

Authentication

All API requests require authentication using API keys:

curl -X GET "https://api.drayrates.ai/api/v1/rates" \
  -H "x-api-key: YOUR_API_KEY"

Getting Your API Key

To obtain your API key for making authenticated requests:

  1. Register: If you haven't already, sign up for an account at https://app.drayrates.ai/register.
  2. Navigate to Settings: Once logged in, go to the Developer settings page: https://app.drayrates.ai/settings/developers.
  3. Copy Your Key: On the Developer settings page, you will find your API key. Copy this key to use in the x-api-key header of your API requests.

Base URL

All API requests should be made to:

https://api.drayrates.ai/api/v1

Rate Limits

  • 1000 requests per minute for standard plans
  • Custom limits available for enterprise plans
  • Burst limits may apply

Response Format

All responses are returned in JSON format:

{
  "success": true,
  "data": {},
  "meta": {
    "request_id": "req_123",
    "timestamp": "2024-01-20T12:00:00Z"
  }
}

Error Handling

Standard HTTP status codes:

  • 200: Success
  • 400: Bad Request
  • 401: Unauthorized
  • 403: Forbidden
  • 429: Too Many Requests
  • 500: Server Error

Error response format:

{
  "success": false,
  "error": {
    "code": "invalid_request",
    "message": "Detailed error message"
  }
}