Authentication

Learn how to authenticate with the Filed API using Bearer tokens. Manage API keys, understand key prefixes, and handle authentication errors.

Bearer Token Authentication

All API requests require an API key passed via the Authorization header using the Bearer scheme:

cURL
curl "https://filed.dev/api/v1/search?name=Acme&state=FL" \
  -H "Authorization: Bearer fd_live_aBcDeFgH"
Python
import requests

headers = {"Authorization": "Bearer fd_live_aBcDeFgH"}
resp = requests.get(
    "https://filed.dev/api/v1/search",
    params={"name": "Acme", "state": "FL"},
    headers=headers
)
Node.js
const res = await fetch(
  "https://filed.dev/api/v1/search?name=Acme&state=FL",
  {
    headers: {
      Authorization: "Bearer fd_live_aBcDeFgH",
    },
  }
);
Go
req, _ := http.NewRequest("GET",
  "https://filed.dev/api/v1/search?name=Acme&state=FL", nil)
req.Header.Set("Authorization", "Bearer fd_live_aBcDeFgH")

resp, _ := http.DefaultClient.Do(req)

API Key Prefixes

API keys use prefixes to indicate their environment:

PrefixEnvironmentDescription
fd_live_ProductionUse for live applications. Counts against your plan limits.
fd_test_TestingUse for development and testing. Same endpoints, same data.

Managing API Keys

You can view and regenerate your API key from your account page. When you regenerate a key, the old key is immediately invalidated.

Keep your API key secret. Do not expose it in client-side code, public repositories, or browser requests. Always make API calls from your server.

Authentication Errors

If your API key is missing, invalid, or expired, you'll receive a 401 Unauthorized response:

{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key. Get one at https://filed.dev/register"
  }
}