Anti-plagiarism with the API
This guide shows how an anti-plagiarism tool, such as Chimpee, checks a new text against what is already published. The route reference is in Content search.
The flow
Section titled “The flow”-
Sample sentences from the text. Pick 3 to 6 sentences of 8 to 15 words, from spread-out points (opening, middle, end). Avoid sentences made only of commonplaces or numbers.
-
Look each excerpt up with search.
GET /v1/searchwithqin quotes ("whole sentence") ormode=phrase. A hit on a long sentence is already a strong sign. Use-termto drop a post you know to be the original. -
Compare the whole text with similarity.
POST /v1/search/similarwith the draft intext(50 to 50,000 characters) or, for a post of yours already published, withpost_id(the post itself is left out). Usemin_words8, the default; lower it to 5 to catch copying with swapped words, raise it up to 30 to cut noise. -
Read the coverage, not just the presence of the item.
similarity(andcoverage.input_covered) is the fraction of your text that appears in the post. A high value, for example above 0.2, with a largelongest_run_wordspoints to relevant copying. A highcoverage.post_coveredwith a lowinput_coveredis usually just a long quote of the post inside your text, or your text being the source of the other. Set the thresholds in your tool and showpassagesto the reviewer:query_start/query_endmark the excerpt in your text,source_start/source_endin the post. -
Paginate search. Pass
next_cursorback ascursor, keeping the same filters, until it isnull. Do not build or interpret the cursor. A400 INVALID_QUERYwithinvalid cursormeans a tampered cursor, one from another query or past the depth limit: restart the query. -
Decide and record. Keep the
post_id(or theurlanddomain, for items of other organizations), thesimilarityand thepassagesthat justified the rejection, for the human reviewer.
curl https://api.canverly.com/v1/search/similar \ -H "Authorization: Bearer ck_live_xxx" \ -H "Content-Type: application/json" \ -d '{"post_id": "019f0a1c-7d2e-7a10-9c4b-2f6a1d0e5b11", "min_words": 8, "limit": 10}'Items from other organizations carry only similarity, longest_run_words, url, title, domain and snippet: no passages or coverage. For a detailed review, the person opens the public url.
Matching across rings with the fingerprint
Section titled “Matching across rings with the fingerprint”To find out whether a text already exists in another ring (.net x .com) without sending the text there, ask for "fingerprint": true in similarity (or fingerprint=true in search). Each item comes back with fingerprint (content_hash, simhash, word_count) and the response carries source_fingerprint for your text, when it fits in up to 20,000 characters. An equal content_hash means the same normalised text; a simhash a few bits apart (Hamming distance) means near-identical texts. Keep only the fingerprints, not the text. On a whole-platform query (Group app), same_org tells what belongs to your organization from what belongs to another. External partners and ck_ keys can ask for fingerprint too, but only receive the fingerprints of their own organization’s posts. Details in Fingerprint.
Quota, 429 and 503
Section titled “Quota, 429 and 503”Search has 600 req/min (burst of 50) and similarity 120 req/min per credential, each with its own bucket. Read RateLimit-Remaining and slow down before it hits zero.
- 429
RATE_LIMITED: waitRetry-Afterseconds. It is not a failure: it is the quota. - 503
DEPENDENCIA_INDISPONIVEL,INDEX_UNAVAILABLEorOVERLOADED: a transient service failure. Retry with exponential backoff and jitter: waitmin(60, 2^attempt)seconds times a random factor between 0.5 and 1.5, honoringRetry-Afterwhen larger, and give up after 5 attempts. Never treat503as an invalid credential. - Other 4xx: do not retry; fix the request.
401,403and404do not improve with a new attempt.501 FILTER_UNSUPPORTEDmeans the filter does not exist yet: remove it from the request.
async function withBackoff(send, max = 5) { for (let t = 0; ; t++) { const r = await send(); if (r.status !== 429 && r.status !== 503) return r; if (t >= max) throw new Error(`gave up after ${t + 1} attempts: ${r.status}`); const hint = Number(r.headers.get('retry-after')) || 0; const wait = Math.min(60, 2 ** t) * (0.5 + Math.random()); await new Promise((ok) => setTimeout(ok, Math.max(hint, wait) * 1000)); }}Draft privacy
Section titled “Draft privacy”The text you send in text is a draft, sometimes someone else’s. The API uses it only to query its own index and does not log it. Do the same on your side: do not send third-party drafts to external services for checking, do not put them in a URL (always use the POST body), do not write them to logs and do not keep them beyond the review.
Known limits
Section titled “Known limits”| What | Value |
|---|---|
| Items per similarity call | limit up to 50, but the source returns up to 20 posts per 20,000-character piece; a limit above 20 can lose matches and comes with truncated: true |
| Short excerpt in a long text | Recall is lower: a copied excerpt shorter than min_words consecutive words never counts, and in a long text a short copy weighs little in similarity. Also check with phrase search |
text |
50 to 50,000 characters; above that, 413 TEXT_TOO_LARGE |
post_id |
Only a published post of yours; above 50,000 characters it is cut (input_truncated: true) |
| Search | limit up to 100; sites up to 100 ids; type, category, tag, update and sort filters still answer 501 |
| Freshness | The index is updated after publication; an item with stale: true may lag slightly behind the post |