Authentication
Every /v1 route requires an API key sent in the X-API-Key request
header. Keys in the query string are rejected: a request carrying an
api_key query parameter fails with 400 regardless of its value.
curl -H "X-API-Key: $SCAT_API_KEY" \
"https://scrapingcat.boyinzhiheng.com/v1/search?engine=google_scholar&q=deep+learning"
- Missing or invalid key →
401 unauthorized. /healthand/readyneed no key.
General query rules: keys may not be duplicated, unknown keys are rejected,
and output (when supplied) must be json.
Errors & status codes
Every error response uses one fixed shape. request_id is unique per request —
include it when reporting a problem.
{
"error": {
"code": "rate_limited",
"message": "Request rate limit exceeded",
"retryable": true
},
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
| Status | Code | Retryable | Meaning |
|---|---|---|---|
| 400 | invalid_parameters | no | Request parameters failed validation |
| 401 | unauthorized | no | Invalid or missing API key |
| 404 | author_not_found, search_not_found, citation_not_found, profiles_not_found, route_not_found, … | no | The requested entity does not exist |
| 409 | conflict | no | Request conflicts with current state (e.g. Idempotency-Key reuse with different content) |
| 410 | expired | no | Resource is past its retention window |
| 413 | request_too_large | no | Upload or body exceeds the size limit |
| 429 | rate_limited, ip_budget_exhausted | yes | Capacity is temporarily unavailable; honor Retry-After when present |
| 502 | upstream_error, scholar_fetch_failed, soft_blocked, parse_error | yes | Google Scholar did not return a usable response |
| 503 | service_unavailable, provider_unavailable, global_circuit_open | yes | Service or upstream capacity is temporarily unavailable |
| 507 | insufficient_storage | yes | Result storage capacity is unavailable |
GET /v1/search
One search endpoint, four engines. The engine parameter selects the target and
determines which other parameters are valid.
engine=google_scholar — organic search
Requires at least one of q, cites, or cluster.
cluster is exclusive with q and cites.
| Parameter | Type | Default | Notes |
|---|---|---|---|
q | string | — | Search query, up to 2048 chars |
cites | digits | — | Cited-by search for a result's citation cluster |
cluster | digits | — | All versions of one clustered result |
as_ylo / as_yhi | int | — | Year range filter |
scisbd | 0 | 1 | 2 | 0 | Sort by date (1: abstracts, 2: everything) |
hl | string | en | Interface language |
lr | string | — | Language restriction, e.g. lang_en|lang_fr |
start | int ≥ 0 | 0 | Result offset for pagination |
num | 1–20 | 10 | Results per page |
as_sdt | string | 0,5 | Search type / patents-and-citations control |
safe | active | off | — | Safe-search toggle |
filter | 0 | 1 | 1 | Similar/omitted-result filtering |
as_vis | 0 | 1 | 0 | Exclude citations from results |
as_rr | 0 | 1 | 0 | Review articles only |
curl -H "X-API-Key: $SCAT_API_KEY" \
"https://scrapingcat.boyinzhiheng.com/v1/search?engine=google_scholar&q=attention+is+all+you+need&num=10"
The response mirrors the SerpApi Google Scholar shape:
search_metadata, search_parameters, search_information,
organic_results[] (with result_id, title, link,
publication_info, inline_links.cited_by, …) and
pagination when more pages exist.
engine=google_scholar_author — author profile
| Parameter | Type | Default | Notes |
|---|---|---|---|
author_id | string | required | The Scholar author identifier, e.g. qc6CJjYAAAAJ |
hl | string | en | Interface language |
view_op | view_citation | list_colleagues | — | Switch to a single citation view or the co-author list |
citation_id | string | — | Required with view_op=view_citation; must belong to author_id |
sort | citations | title | pubdate | citations | Article ordering |
start | int ≥ 0 | 0 | Article offset |
num | 1–100 | 20 | Articles per page |
curl -H "X-API-Key: $SCAT_API_KEY" \
"https://scrapingcat.boyinzhiheng.com/v1/search?engine=google_scholar_author&author_id=qc6CJjYAAAAJ&num=100"
engine=google_scholar_cite — citation export
q is a result_id taken from an organic search response. Returns the
formatted citation styles (MLA, APA, Chicago, Harvard, Vancouver) and export links
(BibTeX, EndNote, RefMan, RefWorks).
curl -H "X-API-Key: $SCAT_API_KEY" \
"https://scrapingcat.boyinzhiheng.com/v1/search?engine=google_scholar_cite&q=KlAl5vgvd-8J"
engine=google_scholar_profiles — profile search
Searches author profiles by name via mauthors. Pagination uses opaque
continuation tokens: pass either after_author or before_author
(mutually exclusive) from a previous response. This surface is best-effort and may
return a retryable upstream error under load.
curl -H "X-API-Key: $SCAT_API_KEY" \
"https://scrapingcat.boyinzhiheng.com/v1/search?engine=google_scholar_profiles&mauthors=Geoffrey+Hinton"
GET /v1/papers/resolve
Deterministic paper lookup against Google Scholar. Supply exactly one selector:
| Selector | Example |
|---|---|
doi | 10.1038/nature14539 |
pmid | 26017442 |
arxiv_id | 1706.03762 |
title | Deep learning |
curl -H "X-API-Key: $SCAT_API_KEY" \
"https://scrapingcat.boyinzhiheng.com/v1/papers/resolve?doi=10.1038/nature14539"
The response reports an explicit match_status — exact,
probable, ambiguous, or not_found — together with the
matched result (identifiers, title, link, citation counts) and the candidates that were
considered, so callers can apply their own acceptance policy.
Durable batches
Batches process thousands of authors or papers asynchronously with durable state: batch metadata, per-item progress, retries, pause/resume, and crash-safe result archives all survive service restarts. Submit inputs, poll status, then download a compressed NDJSON archive of one terminal record per canonical input.
- Author inputs carry
author_id. Paper inputs carry exactly one ofdoi,pmid,arxiv_id, ortitle. - Duplicate inputs are canonicalized; the first occurrence's index is retained.
- An optional
Idempotency-Keyheader makes creation replay-safe: the same key with identical canonical content returns the original batch; the same key with different content returns409.
Batch endpoints
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/batches/authors | Create an inline author batch (JSON body) |
| POST | /v1/batches/authors/upload | Stream a TXT (one author_id per line) or JSONL upload |
| POST | /v1/batches/papers | Create an inline paper batch (JSON body) |
| GET | /v1/batches/{batch_id} | Aggregate status, counters, and timing |
| GET | /v1/batches/{batch_id}/items | Cursor-paginated item projection; optional state/error filters |
| POST | /v1/batches/{batch_id}/pause | Request a durable pause |
| POST | /v1/batches/{batch_id}/resume | Resume a paused batch |
| GET | /v1/batches/{batch_id}/results.ndjson.gz | Download the terminal result archive (gzip NDJSON) |
curl -X POST -H "X-API-Key: $SCAT_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: my-batch-2026-07-17" \
-d '{"items":[{"author_id":"qc6CJjYAAAAJ"},{"author_id":"JicYPdAAAAAJ"}],"options":{"hl":"en"}}' \
"https://scrapingcat.boyinzhiheng.com/v1/batches/authors"
curl -H "X-API-Key: $SCAT_API_KEY" \
-o results.ndjson.gz \
"https://scrapingcat.boyinzhiheng.com/v1/batches/b_01J.../results.ndjson.gz"
Each archive line is one JSON record with the item's original
input_index, canonical input, terminal state, and either the full result document
or a fixed error classification.
Batch & item states
ingesting → queued → running → completed | completed_with_errors | failed
│
└→ pausing → paused → queued (on resume)
Item states: pending, running, retry_wait,
succeeded, not_found, failed. A missing entity (e.g. an
unknown author_id) terminates as not_found, not failed.
Limits & retention
| Limit | Value |
|---|---|
| Inline batch size (authors or papers) | 1 – 10,000 items |
| Author upload | up to 500,000 records / 32 MiB |
| Items page size | 1 – 1,000 |
Search page size (num) | 1 – 20 |
Author page size (num) | 1 – 100 |
| Result archive retention | 7 days after the batch reaches a terminal state |
| Batch metadata retention | 30 days |
429/503 errors rather than queueing silently — back off and retry
with the Retry-After hint when present.Health & readiness
| Endpoint | Auth | Purpose |
|---|---|---|
GET /health | none | Service identity and liveness: {"service":"scrapingcat", "version":..., "status":"ok"} |
GET /ready | none | Readiness: storage write probes, disk admission, and scheduler health; 200 when ready, 503 otherwise. Never contacts Google. |