API Documentation
Programmatic access to the GovernmentFiles.io document archive. Available for Researcher tier subscribers.
Authentication
All API requests require authentication using a Bearer token in the Authorization header.
Authorization: Bearer gf_live_your_api_key_hereGet your API key from the account settings.
Base URL
https://governmentfiles.io/api/v1Search Documents
Search and filter declassified documents.
GET
/api/v1/documentsQuery Parameters:
query- Search query (keyword or semantic)agency- Comma-separated agencies (e.g.,CIA,FBI)collection- Comma-separated collectionstag- Comma-separated tagsyearFrom- Start year (integer)yearTo- End year (integer)tagMode-anyorall(default:any)excludeFoiaLogs-trueorfalselimit- Results per page (1-200, default: 60)offset- Pagination offset (default: 0)
Example Request:
curl -X GET "https://governmentfiles.io/api/v1/documents?query=UFO&agency=CIA&limit=10" \ -H "Authorization: Bearer gf_live_your_api_key_here"
Example Response:
{
"data": [
{
"id": "uuid",
"title": "Document Title",
"agency": "CIA",
"year": 1968,
"summary": "...",
"topics": ["UFO", "Space"],
"pdfUrl": "https://...",
"sourceUrl": "https://..."
}
],
"error": null,
"meta": {
"total": 10,
"limit": 10,
"offset": 0,
"hasMore": true
}
}Rate Limits
Each API key has a rate limit of 10,000 requests per month. The limit resets monthly.
If you exceed the limit, you'll receive a 429 Too Many Requests response. Contact support if you need higher limits.
Error Responses
401 UnauthorizedInvalid or missing API key
403 ForbiddenAPI key disabled or subscription inactive
429 Too Many RequestsRate limit exceeded
Getting Started
- Upgrade to the Researcher tier ($39/month)
- Create an API key from your account settings
- Save your API key securely (you won't be able to see it again)
- Start making API requests using the examples above