Search documents with Solr-style query syntax, with highlighted matches.
GET/documents/search/
- Takes: Name
- Passive: the target is not contacted
Searches the text of documents you can see. Supports phrases in double quotes, fuzzy terms with ~, and fielded queries; wildcards need an authenticated user. The response includes a top-level count and, with hl=true, a highlights object per result.
Query parameters
qSearch query (Solr syntax, phrases in double quotes)
hlReturn highlighted matches
per_pageResults per page: 25 by default; up to 100 for authenticated users
Response fields · 14ShowHide
count
Total documents matching the search
next
URL of the next page or null
previous
URL of the previous page or null
id
Document ID
title
Document title
slug
URL-safe title
source
Who produced the document
access
public, private or organization
status
Processing status
language
Document language
page_count
Number of pages
created_at
Creation time
highlights
Matched snippets keyed by field or page, with <em> around hits
asset_url
Base URL for the document's static assets
curl 'https://api.www.documentcloud.org/api/documents/search/?q=annual%20report' \
-H 'Authorization: Bearer YOUR_API_KEY'{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "1000001",
"user": 100000,
"organization": 10001,
"access": "public",
"status": "success",
"title": "example-annual-report",
"slug": "example-annual-report",
"source": "Example Agency",
"language": "eng",
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-02T00:00:00.000Z",
"page_count": 12,
"highlights": {
"title": [
"example-<em>annual</em>-<em>report</em>"
]
},
"data": {},
"asset_url": "https://assets.example.org/"
}
]
}