API Reference

Complete reference for all SeaLegs API endpoints

Base URL

All API requests should be made to:

https://api.sealegs.ai/v3

Request Format

All requests must include:

  • Authorization header: Authorization: Bearer YOUR_API_KEY
  • Content-Type header: Content-Type: application/json (for POST/PUT requests)
curl -X POST https://api.sealegs.ai/v3/spotcast \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"coordinates": {"latitude": 25.76, "longitude": -80.19}, ...}'

Response Format

All responses are returned as JSON. Successful responses have a 2xx status code.

Success Response

{
  "id": "spc_abc123xyz",
  "status": "completed",
  "created_at": "2025-12-01T10:30:00Z",
  ...
}

Error Response

{
  "error": {
    "code": "invalid_coordinates",
    "message": "Latitude must be between -90 and 90",
    "param": "coordinates.latitude"
  }
}

Endpoints Overview

SpotCast Endpoints

Method Endpoint Description Credits
POST /v3/spotcast Create a new SpotCast forecast 1
GET /v3/spotcast/{id} Get SpotCast with latest forecast 0
GET /v3/spotcast/{id}/status Get processing status 0
POST /v3/spotcast/{id}/refresh Create new forecast for existing SpotCast 1
GET /v3/spotcast/{id}/forecasts List all forecasts for a SpotCast 0
GET /v3/spotcasts List all your SpotCasts 0

Account Endpoints

Method Endpoint Description
GET /v3/developer/info Get account information and balance

Common Parameters

Coordinates

Parameter Type Description
latitude number Latitude (-90 to 90)
longitude number Longitude (-180 to 180)

Pagination

List endpoints support cursor-based pagination:

Parameter Type Description
limit integer Number of items to return (default: 20, max: 100)
after string Cursor for pagination (from previous response)

Paginated responses include:

{
  "data": [...],
  "has_more": true,
  "next_cursor": "spc_xyz789"
}

Rate Limiting

All responses include rate limit headers:

Header Description
X-RateLimit-Limit Maximum requests per minute
X-RateLimit-Remaining Remaining requests in current window
X-RateLimit-Reset Unix timestamp when the window resets

See Rate Limits for more details.

HTTP Status Codes

Code Description
200 Success
201 Created
202 Accepted (async processing started)
400 Bad Request (invalid parameters)
401 Unauthorized (missing/invalid API key)
402 Payment Required (insufficient credits)
403 Forbidden (valid key but lacks permission)
404 Not Found
429 Too Many Requests (rate limited)
500 Internal Server Error

Next Steps