Getting Started

Authentication

Server-side keys, one header and a clean rotation path. Test keys and live keys share the same request shape.

x-api-key: cf_live_...No charge for authentication
auth: x-api-keycontent-type: application/jsonenvelope: data + meta
request.sh
curl -s "https://api.cleanfetch.dev/v1/linkedin/profile?url=https://www.linkedin.com/in/williamhgates" \
  -H "x-api-key: $CLEANFETCH_API_KEY"
response.json
200 OK / application/json
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid x-api-key"
  },
  "meta": {
    "requestId": "req_cf_01j9k9a11aa",
    "creditsCharged": 0
  }
}

The header

Send x-api-key on every request. Keys are scoped to one workspace and inherit its plan, credit balance and rate limit. Do not use a query parameter for the key because URLs are commonly logged.

Test and live keys

Test keys return deterministic fixtures and never charge live credits. Live keys call the public upstreams. Both use the same endpoints, so a test integration can move to live by swapping one environment variable.

Rotation

Create the replacement key, deploy it, confirm traffic, then revoke the old key. Two keys can be active at once during a rotation window.

Client-side warning

Never ship a live key in a mobile app, a browser bundle or a public notebook. Route requests through your own server or an edge function and keep the key in a secret store.

ready