Shipwrecked API

API Authentication

Secure access to maritime data and ship operations with API keys and OAuth 2.0 authentication.

🟠 API Key Authentication

How it works

  1. 1. Request API key from your organization's admin
  2. 2. Store as an environment variable
  3. 3. Include in the Authorization header
curl -X GET "https://api.shipwrecked.co/v1/vessels/12345" \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json"
                

🔒 OAuth 2.0 Authentication

Client Credentials Flow

curl -X POST "https://api.shipwrecked.co/oauth/token" \
     -u "CLIENT_ID:CLIENT_SECRET" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "grant_type=client_credentials"
                

Returns a JSON web token (JWT) which should be used in the Authorization header:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                

💎 Comparison Table

Feature
OAuth 2.0
Token Lifespan
30 minutes
Refresh Mechanism
Automatic
Rate Limit
Unlimited
Scopes
Customizable
Revocation
Available

Related Resources

Managing API Keys

Create, revoke, and rotate API keys for your organization

OAuth 2.0 Guide

Full walkthrough of the client credentials flow