Using the API with AI Agents
This page explains where AI agents find these docs in a machine-readable format, and which rules an agent should follow when it works with the API.
LLM-Ready Docs
These docs are available in a machine-readable format, following the llms.txt convention.
| File | Description | Link |
|---|---|---|
llms.txt | An index of every documentation page with links and descriptions. | /llms.txt |
llms-full.txt | The full text of the documentation in a single file for direct ingestion. | /llms-full.txt |
*.md | Every page as plain Markdown. llms.txt links to these files. | e.g. /actor-profiles.md |
Give your agent the link to this page, or to llms.txt, and hand over the API key the way the agent asks for secrets, for example as an environment variable.
Instructions for Agents
The rest of this page is written for the agent. It summarizes what the reference pages say and links to them; the reference pages are authoritative. Don't assume endpoints, parameters or fields that are not documented there.
Authentication
Send the API key with every request in the Authorization header (see Authentication):
curl "https://www.filmmakers.eu/api/v1/actor_profiles" \
-H "Authorization: Token token=$FILMMAKERS_API_KEY"
Keep the Key Secret
The API key is a secret that belongs to its owner.
- Read it from an environment variable or a secret store. Never hard-code it.
- Never put it in client-side JavaScript, in build output that gets published, or in a repository. Add files that contain it (such as
.env) to.gitignore. - Don't print it in logs, build output or error messages.
- Only call the API from code that runs on a server or at build time. The API supports CORS, but a request from a browser would expose the key to every visitor.
Know What the Key Can Access
The permission scope depends on the API key, see Getting an API Key. Only use the endpoints the key is meant for, and don't retry a request that was answered with 403 Forbidden.
Handling Errors
See Error Codes for the general rules.
| Response | Meaning | What to do |
|---|---|---|
401 | The key is not valid (any more), e.g., because a new key was generated or the key expired. | Ask the owner of the key for a new one. |
403 | The key doesn't allow the request. | Don't retry. |
410 Gone | The resource was merged or deleted. | Follow new_id for merged resources and drop deleted ones, as described in Error Codes. |
429 | The rate limit was exceeded. | Wait until the time given in the Ratelimit-Reset header, see Rate Limits. |
Cache responses instead of requesting the same data again, and keep the data you already have when a request fails.
Write Code That Keeps Working
The API changes over time in ways we consider backwards compatible. Write code accordingly:
- Ignore fields you don't know, and don't fail when a field is
nullor an optional field is missing. - Don't rely on the default page length. Pass
per_pageyourself and follow theLinkheader as described in Pagination. - Don't hard-code lists of attribute values or their translations. Fetch them from the Attributes endpoints.
- Don't use fields marked as deprecated in the reference. Use the replacement named there.
- Check the Changelog for new fields.