API reference
Reference verification
Draft
POST https://paperpurr.com/v1/citations/verify
Check each reference against Crossref and OpenAlex and flag whether it matches, differs or can’t be found.
Body parameters
referencesstring[] · required- 1–20 items, each a full reference of up to 2000 characters, in any style (APA, MLA, IEEE, GB/T 7714 and so on).
Examples
curl
curl -X POST "https://paperpurr.com/v1/citations/verify" \
-H "Authorization: Bearer $PAPERPURR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"references":["Smith, J. (2020). Title. Journal, 12(3), 45-67.","Lee, K. (2018). Writing with sources. Academic Press.","张三. 学术写作导论[M]. 北京: 高等教育出版社, 2019."]}'Python
import os
import requests
r = requests.post(
"https://paperpurr.com/v1/citations/verify",
headers={"Authorization": f"Bearer {os.environ['PAPERPURR_API_KEY']}"},
json={
"references": [
"Smith, J. (2020). Title. Journal, 12(3), 45-67.",
"Lee, K. (2018). Writing with sources. Academic Press.",
"张三. 学术写作导论[M]. 北京: 高等教育出版社, 2019."
]
},
)
print(r.json())JS
const r = await fetch("https://paperpurr.com/v1/citations/verify", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PAPERPURR_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"references": [
"Smith, J. (2020). Title. Journal, 12(3), 45-67.",
"Lee, K. (2018). Writing with sources. Academic Press.",
"张三. 学术写作导论[M]. 北京: 高等教育出版社, 2019."
]
}),
});
console.log(await r.json());Response
200
{
"results": [
{
"index": 0,
"status": "matched",
"match": {
"title": "Title",
"authors": [
"J. Smith"
],
"year": 2020,
"venue": "Journal",
"doi": "10.1234/journal.2020.045",
"url": "https://doi.org/10.1234/journal.2020.045",
"source": "crossref"
}
},
{
"index": 1,
"status": "mismatch",
"diffs": [
{
"field": "year",
"ours": "2018",
"found": "2019"
}
],
"match": {
"title": "Writing with Sources",
"authors": [
"K. Lee"
],
"year": 2019,
"venue": "Academic Press",
"doi": "10.5555/wws.2019",
"url": "https://doi.org/10.5555/wws.2019",
"source": "crossref"
}
},
{
"index": 2,
"status": "skipped",
"reason": "cjk"
}
],
"usage": {
"units": 2,
"remaining": 495
},
"request_id": "req_51d0c8aa3e9f4b2c7d16a0e8"
}400
{
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "references 要是非空的字符串数组",
"param": "references",
"request_id": "req_6a2f90d4e1b7c3a85d02f9e4"
}
}402
{
"error": {
"type": "billing_error",
"code": "insufficient_balance",
"message": "本月试用额度不足:这次需要 3 单位,剩余 2",
"param": null,
"request_id": "req_2c7e1f0a9b3d45e6c8a1f7d2"
}
}resultsobject[] · required- One per item in
references, in orderindexinteger · required- Position in
references, starting at 0 statusstring · requiredmatched,mismatch,not_found,skippedorerror. See belowreasonstring- Only on
skipped:cjk,weborshort diffsobject[]- Only on
mismatch: the fields that differfieldstring · requiredyear,authors,titleordoioursstring- What the reference says
foundstring- What the database has
otherstring- Only on
doi: the title of the work the cited DOI actually points to
matchobject- The closest record, with the same fields as Citation lookup
results[]
usage.unitsinteger · required- Units this call cost: the number of references actually checked
usage.remaininginteger · required- Trial units left this month after this call
request_idstring · required- Request ID
Verification results
| status | Meaning | Charged |
|---|---|---|
matched | Matches the database record | Yes |
mismatch | Found, but the year, authors, title or DOI differ. See diffs | Yes |
not_found | Not found in Crossref or OpenAlex | Yes |
skipped | Not checked. See reason | No |
error | This item failed. You can retry it on its own | No |
| reason | Meaning |
|---|---|
cjk | Chinese, Japanese or Korean entries. Coverage in these databases is too thin, so they aren’t checked yet |
web | A web page with too little bibliographic information |
short | Too short to be a full reference, such as a blank line or a heading |
Possible errors
| Status | code | Cause | What to do |
|---|---|---|---|
400 | missing_parameter | A required parameter is missing. param names it. | Add the parameter. |
400 | invalid_parameter | A parameter has the wrong type or value. param names it. | Fix it to match the type and range in the reference. |
400 | unknown_parameter | The request has a query parameter or body field the endpoint doesn’t accept. | Remove it or check the spelling. |
400 | invalid_json | The request body isn’t a JSON object. | Send a single JSON object with Content-Type: application/json. |
413 | too_many_references | references has more than 20 items. | Split into batches of up to 20. |
413 | body_too_large | The request body is too large. | Send fewer or shorter items. |
402 | insufficient_balance | This month’s trial allowance doesn’t cover the units this request needs. | Check /v1/usage, send fewer items or wait for next month’s reset. Word packs go on sale at launch. |
429 | rate_limit_exceeded | A rate limit was hit (per IP, per key or per account). message says which. | Wait the number of seconds in Retry-After, then retry. Queue requests if several processes share one key. |
503 | busy | The service is busy. Billable calls also return this when usage can’t be recorded, and nothing is charged. | Retry with backoff. |
See Authentication for auth errors and Errors for the full list.
Metering
- Charged per reference actually checked: 1 unit each for
matched,mismatchandnot_found.skippedanderrorare free. - Units for the whole batch are reserved first. If you don’t have enough left, it returns
402and nothing is checked. After checking, you’re charged only for what was actually checked. - Only the entries you list are sent. You never upload your paper.