Retrieve current market rate for a specific lane.
GET /api/v1/rates
Parameter | Type | Required | Description |
---|
origin | string | Yes | Origin city or zip code |
destination | string | Yes | Destination city or zip code |
equipment_type | string | Yes | Type of equipment (e.g., 'dryvan', 'reefer') |
date | string | No | Rate date (YYYY-MM-DD). Defaults to current date |
curl -X GET 'https://api.drayrates.ai/api/v1/rates?origin=USLAX&destination=USCHI&equipment_type=dryvan' \
-H 'Authorization: Bearer YOUR_API_KEY'
{
"rate": {
"base_rate": 2850.0,
"fuel_surcharge": 425.0,
"total_rate": 3275.0,
"currency": "USD"
},
"market_data": {
"confidence_score": 0.85,
"sample_size": 124,
"last_updated": "2024-03-20T15:30:00Z"
},
"route": {
"origin": "USLAX",
"destination": "USCHI",
"distance_miles": 2004,
"estimated_transit_days": 3
}
}
Retrieve historical rate trends for a specific lane.
GET /api/v1/rates/historical
Parameter | Type | Required | Description |
---|
origin | string | Yes | Origin city or zip code |
destination | string | Yes | Destination city or zip code |
equipment_type | string | Yes | Type of equipment |
start_date | string | Yes | Start date (YYYY-MM-DD) |
end_date | string | Yes | End date (YYYY-MM-DD) |
curl -X GET 'https://api.drayrates.ai/api/v1/rates/historical?origin=USLAX&destination=USCHI&equipment_type=dryvan&start_date=2024-01-01&end_date=2024-03-20' \
-H 'Authorization: Bearer YOUR_API_KEY'
{
"historical_rates": [
{
"date": "2024-01-01",
"base_rate": 2750.0,
"total_rate": 3150.0
},
{
"date": "2024-02-01",
"base_rate": 2800.0,
"total_rate": 3200.0
},
{
"date": "2024-03-01",
"base_rate": 2850.0,
"total_rate": 3275.0
}
],
"trend_analysis": {
"average_rate": 3208.33,
"rate_volatility": "low",
"trend_direction": "upward"
}
}
Status Code | Description |
---|
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid API key |
404 | Not Found - No rates available for the specified route |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
{
"error": {
"code": "INVALID_PARAMETERS",
"message": "Invalid origin location provided",
"details": {
"field": "origin",
"reason": "Location code INVALID not found"
}
}
}