Availability and cost
Availability: Paste Leaks. Plans and quotas lists what each plan includes. Cost: no metered allowance. As with every call made with an API key, each call that returns2xx counts once against your monthly API Calls allowance, and that includes every poll. See Rate limits.
Without the feature, or when your license is not active, every endpoint on this page returns 403:
429 here always comes from the per-second rate limit or the API Calls allowance. Errors explains each body.
Run a search
1
Create the search
paste-search-create starts the job and returns 202.job_id. status is queued, or completed when the job reused a recent identical search. message is for information only and names an internal path: always read the job with paste-search-detail.2
Poll until it ends
paste-search-detail/{job_id} returns the job and its status.Poll every 2 to 5 seconds. Each poll that returns
200 counts against your API Calls allowance, and results stays empty with total at 0 until status is completed. include_google_search adds 5 to 30 seconds to a job. A search that runs longer than 180 seconds ends in error:3
Read the matches
Once
status is completed, the same call returns the matches. Page and filter them with the query parameters.Request body
Query syntax
The database search reads Boolean queries:- Every positive term needs 2 characters or more. A shorter one returns
400with{"detail": "Search terms must be at least 2 characters. Too short: a"}. - A query needs at least one positive term.
NOT giveawayalone returns400with{"detail": "Query must contain at least one positive search term."}. - Google gets the same logic. With
include_google_search, each term or phrase is sent to Google in quotes.ANDbecomes a space,ORstaysOR,NOTbecomes Google’s-exclusion, and parentheses keep their grouping.
Reuse within one hour
When your organization ran an identical search that completed in the last hour, a new job reuses its matches instead of searching again. The create call then returnsstatus: "completed" at once, and every match has is_new: false.
Identical means the same query, context_chars, paste_site_ids, unique_only and include_google_search. You cannot force a fresh run of an identical request within that hour. A request that differs in any of those fields runs fresh.
Filter and page the matches
paste-search-detail/{job_id} takes these query parameters. Filters combine with AND, and total counts the matches left after filtering.
A date the source cannot read is ignored rather than rejected.
What comes back
status,error_message— the job state and, onerror, the reason.created_at,started_at,completed_at— the job’s timestamps.total— matches after your filters.db_results,live_results— matches from the index and from Google, before filters. Both arenulluntil the job completes.sites_matched— distinct paste sites with a match.available_authors,available_sites— every distinct author and site name in the job’s matches. They do not shrink when you filter, so use them to buildauthorandsite_namefilters.
A job keeps at most 1,000 database matches. Without
unique_only, those are the 1,000 newest. Live results come on top. For a broad term, narrow the query with AND or a phrase rather than reading total as a full count.results is one paste:
id— the paste’s ID in the index, ornullfor a live result.external_id— the paste’s ID on its site.url— a direct link to the paste.title,author— as posted, ornull.date— when the paste was published, ornull.text_preview— an excerpt about twicecontext_charswide, starting about 60 characters before the match. With several search terms it shows one snippet per matched term, separated by[…], and the snippets share that width.site_name,base_url— the paste site.content_hash— a SHA-256 fingerprint of the paste text. The same text posted twice has the same hash.source—databasefor the index,livefor Google.is_new—truewhen this paste text did not appear in your organization’s most recent earlier completed run of the samequerytext. On the first run of a query, every match is new. A reused job marks every matchfalse.
List past searches
paste-search-history lists your organization’s paste search jobs, newest first.
pageis 1-based.page_sizedefaults to20, max100.query_filterkeeps jobs whose query contains the text, case-insensitive.- The response holds
items,total,pageandpage_size. - Each item carries
job_id,query,status,total_results,db_results,live_results,sites_matched,include_google_search,created_atandcompleted_at. Read a job’s matches withpaste-search-detail.
job_id to read them again.
Cancel a queued search
paste-search-destroy/{job_id} cancels a job that is still queued and returns {"job_id": "...", "status": "cancelled"}. A job that is running or has ended cannot be cancelled.