API ki te kite i te whakawāteatanga: tuku i te kupu, pātai ki te pūrongo.
He tokomaha nga wāhi mutunga, te mana kaihautū, te utu ā-pūtea mārama. I hangaia mō ngā kaporeihana, ngā pūrere tuhituhi me ngā utauta LMS-tata.
Ko tōtou kī API
Kei te tāuru i tōna pūtātau API. Ko ngā pūtātau e tae ana ki ia pūkete; Ka whakapūtātia ngā tātari API ki ngā pūtea.
Ka whakaingoatia te whakaingoatangaWhakamutunga
POST /api/v1/check/
Whakahauhau i tētahi kupu hei whakamātautau. Ka hoki ki te 202 me tētahi tātari_id. Rōpū: JSON me tētahi āpure kupu, āhua ā-pūtātau ā-pūtātau.
curl -X POST https://plagiarism.free/api/v1/check/ \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "The text you want to check..."}'
GET /api/v1/check/<check_id>/
Ko te pāpāhotanga mō te tūnga; ina mahia te tūnga, kei roto te pūrongo katoa: te pūkete, ngā momo ōrite-whakapae me te whakapono me ngā whakahuatanga pūtake, me te rārangi pūtake.
curl https://plagiarism.free/api/v1/check/CHECK_ID/ \ -H "Authorization: Bearer YOUR_KEY"
GET /api/v1/checks/
Ko te rārangi o ngā arotakenga o nāianei, te tuatahi o te hōu. Ko ngā tohu arotake ā-pātahi: te tepe (1-100, te pūmau 20) me te tūnga (whakatautau, i oti, i whakapeka...). Whakatautau i ngā tono me te whakarerekē i tō rātou ake papatono kāore i te rokirokia tātari_id.
curl "https://plagiarism.free/api/v1/checks/?limit=20&status=done" \ -H "Authorization: Bearer YOUR_KEY"
DELETE /api/v1/check/<check_id>/
Delete a finished check: the submitted text and its report are removed for good. Use it to honour your own users' deletion requests. A check that is still queued or running answers 409; delete it once it is done or failed.
curl -X DELETE https://plagiarism.free/api/v1/check/CHECK_ID/ \ -H "Authorization: Bearer YOUR_KEY"
Tauira Python
import time
import requests
API = "https://plagiarism.free/api/v1/check/"
HEADERS = {"Authorization": "Bearer YOUR_KEY"}
r = requests.post(API, json={"text": open("essay.txt").read()}, headers=HEADERS)
check_id = r.json()["check_id"]
while True:
report = requests.get(f"{API}{check_id}/", headers=HEADERS).json()
if report["status"] in ("done", "failed"):
break
time.sleep(3)
print(report["score_pct"], "% matched")
for source in report["sources"]:
print(source["pct_of_document"], source["url"])
Hei tauira
const API = "https://plagiarism.free/api/v1/check/";
const headers = { "Authorization": "Bearer YOUR_KEY", "Content-Type": "application/json" };
const { check_id } = await fetch(API, {
method: "POST", headers, body: JSON.stringify({ text })
}).then(r => r.json());
let report;
do {
await new Promise(res => setTimeout(res, 3000));
report = await fetch(`${API}${check_id}/`, { headers }).then(r => r.json());
} while (!["done", "failed"].includes(report.status));
Whakataurite
He ōrite ki te pae: 1 te pūtea = 1,000 ngā kupu i whakamātauria, i whakarurua ki ia tātari; ko ngā tātaritanga hōhonu e utu ana i te rua. He tika ngā pakipū pūtea mo ngā rā 365; ko ngā tātai i te marama e tāpiri ana, ā, kei roto ko te API i ia taumata. Kāore he taumata API motuhake, kāore he utu ā-rohe. Tirohia ngā mahere me ngā pakiaka
Checks run asynchronously: real, rate-limited web retrieval usually takes about a minute once a check starts, longer for long documents and at busy times. Poll the status endpoint rather than holding the connection open. HTTP 402 means insufficient credits; the response includes what the check would cost.