Veuillez noter que la version 2 de l'API deviendra obsolète après le 1er janvier 2024.
https://api.plagium.com/v2/document
Argument | Requis | Description |
---|---|---|
key | oui | Votre clé API |
password | au | Votre mot de passe API s'il est défini |
data.text | oui | Texte |
data.title | au | Titre du document |
data.description | au | Description du document |
data.author | au | Auteur du document |
data.keywords | au | Mots-clés du document |
data.source | au | Portée de la recherche. Valeurs possibles: – web: recherche sur le Web – file: comparer avec mes documents La valeur par défaut est : [“web”]. |
data.type | au | Type de recherche. Valeurs possibles: – quick: pour une recherche rapide (disponible uniquement avec data.source=web) – deep: pour une recherche approfondie. La valeur par défaut est : “deep”. |
data.url_filter | au | Domaine ou URL à exclure des résultats séparés par un espace ou un saut de ligne. |
data.import_id | au | L'identifiant de votre document pour une utilisation de consolidation |
data.min_rank | au | Pourcentage minimum (0 à 100) de mots significatifs courants entre deux phrases. La valeur par défaut est : 45.0. |
data.min_relation | au | Similitude minimale (0,0 à 1,0) entre deux phrases. La valeur par défaut est : 0.4. |
data.webhook.url | au | Le webhook enverra une requête HTTP POST à votre application avec des informations sur votre recherche. |
data.webhook.format | au | Format de données du webhook. Valeurs possibles: – simple: envoyer uniquement les informations de recherche et de coût – document: envoyer des informations sur le document, la recherche et le coût. La valeur par défaut est : simple. |
data.webhook.metadata | au | Métadonnées du webhook. Les données utilisateur peuvent être n'importe quel objet JSON. Les métadonnées sont renvoyées avec le rappel du webhook. |
var request = require('request');
var body={
key:"YOUR API KEY",
data: {
title:"Abraham Lincoln",
text:"Abraham Lincoln was an American statesman and lawyer who served as the 16th President of the United States from March 1861 until his assassination in April 1865. Lincoln led the United States through the American Civil War—its bloodiest war and perhaps its greatest moral, constitutional, and political crisis.",
import_id:"YOUR DOCUMENT ID",
source:["web","file"],
url_filter:"en.wikipedia.org\nfr.wikipedia.org/wiki/Thomas_Edison",
read:"private",
webhook: {
url:"https://your_app_webhook_address",
format:"document",
metadata:{
my_metadata:{}
}
}
}
};
request.post("https://api.plagium.com/v2/document", { json: true, body: body },
function(err, res, body) {
if (err) console.error(err);
else {
console.log(body.obj._id);
}
});
Utiliser body.obj._id
pour de futures références.
{
"data": {
"key": "YOUR API KEY",
"type": "document",
"data": {
"import_id": "YOUR DOCUMENT ID",
"text": "Abraham Lincoln was an American statesman and lawyer who served as the 16th President of the United States from March 1861 until his assassination in April 1865. Lincoln led the United States through the American Civil War—its bloodiest war and perhaps its greatest moral, constitutional, and political crisis.",
"min_rank": 40,
"min_relation": 0.33,
"webhook": {
"url": "https://your_app_webhook_address",
"format": "document"
}
}
},
"obj": {
"_id": "12345678-1234-1234-1234-12345678",
"obj": {
"import_id": "YOUR DOCUMENT ID",
"active": true,
"data": {
"profile": {
"title": "Abraham Lincoln"
},
"privacy": {
"read": "private"
},
"search": {
"status": "waiting",
"type": "deep",
"source": ["web"],
"from": "text",
"text": "Abraham Lincoln was an American statesman and lawyer who served as the 16th President of the United States from March 1861 until his assassination in April 1865. Lincoln led the United States through the American Civil War—its bloodiest war and perhaps its greatest moral, constitutional, and political crisis.",
"similarity": {
"min_relation": 0.33,
"min_rank": 40
},
"webhook": {
"url":"https://your_app_webhook_address",
"format":"document"
},
"version": 0
},
"urls": {
"edit": "https://premium.plagium.com/admin/en/documents/id/12345678-1234-1234-1234-12345678",
"report": "https://premium.plagium.com/admin/en/report/id/12345678-1234-1234-1234-12345678",
"print": "https://premium.plagium.com/admin/en/print/report/12345678-1234-1234-1234-12345678"
}
},
"type": "document",
"rights": {
"ownedby": "aaaaaaaa-aaaa-aaaa-aaaaaaaa,
"createdby": "api",
"created": 1554848878747,
"modifiedby": "api",
"modified": 1554848878747
}
}
},
"api": {
"version": "2.0.5",
"name": "api",
"date": 1554848938125
}
}
{
"obj": {
"_id": "12345678-1234-1234-1234-12345678",
"obj": {
"data": {
"stats": {
"time": {
"parse": 0,
"compare": 1350,
"search": 440,
"sort": 0,
"pct": 2,
"total": 1665,
"download": 319
},
"proximity": {
"sentence": 0,
"score": {
"document": 80,
"page": 80,
"paragraph": 80,
"sentence": 80
},
"page": 100,
"document": {
"pct_length": 100,
"pct_selected_queries": 100,
"pct_selected": 100,
"pct": 100,
"pct_selected_length": 100,
"pct_queries": 100
},
"paragraph": 100
},
"results": {
"kept": 5,
"downloaded": 8,
"found": 8
},
"steps": {
"search": 1,
"compare": 1,
"download": 1
},
"download_round": 1,
"processor_version": 13,
"compare_completed": true,
"download_completed": true,
"search_round": 1,
"compare_round": 0,
"search_completed": true
},
"file": {
"key": "fcf52ae0-5b39-11e9-bb64-ad0e064387d9"
},
"search": {
"version": 0,
"similarity": { "min_relation": 0.33, "min_rank": 40 },
"source": ["web"],
"status_pct": null,
"status_updated": 1554870223885,
"from": "text",
"text": "Abraham Lincoln was an American statesman and lawyer who served as the 16th President of the United States from March 1861 until his assassination in April 1865. Lincoln led the United States through the American Civil War—its bloodiest war and perhaps its greatest moral, constitutional, and political crisis.",
"type": "deep",
"webhook": {
"url":"https://your_app_webhook_address",
"format": "document"
}
"status": "ready"
},
"privacy": { "read": "private" },
"profile": {
"title": "Abraham Lincoln"
},
"urls": {
"edit": "https://premium.plagium.com/admin/en/documents/id/12345678-1234-1234-1234-12345678",
"report": "https://premium.plagium.com/admin/en/report/id/12345678-1234-1234-1234-12345678",
"print": "https://premium.plagium.com/admin/en/print/report/12345678-1234-1234-1234-12345678"
}
},
"rights": {
"created": 1554864020611,
"modifiedby": "lambda",
"modified": 1554870223885,
"createdby": "api",
"ownedby": "aaaaaaaa-aaaa-aaaa-aaaaaaaa"
},
"active": true,
"import_id": "my_import_id",
"type": "document"
}
},
"search": {
"_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"obj": {
"data": {
"obj_id": "12345678-1234-1234-1234-12345678",
"obj_type": "document",
"obj_import_id": "my_import_id",
"search": {
"status": "ready",
"type": "deep",
"source": ["web"],
"precision": 90,
"similarity": {
"min_rank": 40,
"min_relation": 0.33
}
},
"cost": {
"size": 33,
"length_queries": 32,
"nb_sentences": 1,
"nb_searchable_sentences": 1,
"nb_queries": 1,
"length_selected_queries": 32,
"nb_selected_queries": 1,
"nb_pages": 1,
"nb_words": 5
},
"payment": {
"no_credit": false,
"no_charge": false,
"charge_parent": false,
"documents": 0,
"pages": 0,
"words": 0,
"characters": 0,
"currency": {
"usd": 0.08,
"eur": 0,
"brl": 0,
"mxn": 0,
"inr": 0
},
"need": {
"usd": 0.08,
"eur": 0.07,
"brl": 0.22,
"mxn": 0,
"inr": 4
}
},
"stats": {
"processor_version": 13,
"search_completed": true,
"search_round": 1,
"download_completed": true,
"download_round": 1,
"compare_completed": true,
"compare_round": 0,
"results": {
"found": 8,
"kept": 5,
"downloaded": 8
},
"proximity": {
"document": {
"pct_queries": 100,
"pct_length": 100,
"pct": 100,
"pct_selected_queries": 100,
"pct_selected_length": 100,
"pct_selected": 100
},
"score": {
"document": 80,
"page": 80,
"paragraph": 80,
"sentence": 80
},
"page": 100,
"paragraph": 100,
"sentence": 0
},
"time": {
"total": 6619,
"parse": 0,
"search": 1674,
"sort": 0,
"pct": 2,
"download": 2614,
"compare": 2735
},
"steps": {
"search": 1,
"download": 1,
"compare": 1
}
}
},
"type": "search",
"active": true,
"rights": {
"ownedby": "aaaaaaaa-aaaa-aaaa-aaaaaaaa",
"createdby": "lambda",
"created": 1554870330685,
"modifiedby": "lambda",
"modified": 1554870330685
}
}
}
}
https://api.plagium.com/v2/results
Argument | Requis | Description |
---|---|---|
key | oui | Votre clé API. |
password | au | Votre mot de passe API s'il est défini. |
data.id | oui | L'identifiant de votre document : le _id champ. |
var request = require('request');
var body={
key:"YOUR API KEY",
data: {
id:"DOCUMENT ID"
}
};
request.post("https://api.plagium.com/v2/results", { json: true, body: body },
function(err, res, body) {
if (err) console.error(err);
else {
if (body.results) {
for (var r of body.results) {
console.log(r.result.title);
console.log(r.result.url);
console.log(r.score);
}
}
}
});
{
"data": {
"key": "YOUR API KEY",
"type": "results",
"data": {
"id": "12345678-1234-1234-1234-12345678"
}
},
"obj": {
"_id": "12345678-1234-1234-1234-12345678",
"obj": {
"data": {
"stats": {
"time": {
"parse": 0,
"compare": 8506,
"search": 81,
"sort": 0,
"pct": 0,
"total": 5220,
"download": 571
},
"proximity": {
"sentence": 0,
"score": {
"document": 100,
"page": 100,
"paragraph": 100,
"sentence": 100
},
"page": 100,
"document": {
"pct_length": 100,
"pct_selected_queries": 100,
"pct_selected": 100,
"pct": 100,
"pct_selected_length": 100,
"pct_queries": 100
},
"paragraph": 100
},
"results": {
"kept": 26,
"downloaded": 36,
"found": 36
},
"steps": {
"search": 1,
"compare": 1,
"download": 1
},
"download_round": 1,
"processor_version": 13,
"compare_completed": true,
"download_completed": true,
"search_round": 1,
"compare_round": 0,
"search_completed": true
},
"payment": {
"pages": 0,
"words": 0,
"documents": 0,
"no_charge": false,
"characters": 0,
"currency": {
"eur": 0,
"brl": 0,
"mxn": 0,
"inr": 0,
"usd": 0.08
},
"need": {
"inr": 4,
"mxn": 0,
"usd": 0.08,
"brl": 0.22,
"eur": 0.07
},
"charge_parent": false,
"no_credit": false
},
"search": {
"version": 0,
"similarity": {
"min_relation": 0.33,
"min_rank": 45
},
"source": [
"web"
],
"status_pct": null,
"status_updated": 1554868124901,
"from": "text",
"text": "Abraham Lincoln was an American statesman and lawyer who served as the 16th President of the United States from March 1861 until his assassination in April 1865. Lincoln led the United States through the American Civil War—its bloodiest war and perhaps its greatest moral, constitutional, and political crisis.",
"type": "deep",
"webhook": {
"url": "https://your_app_webhook_address",
"format": "document"
},
"status": "ready"
},
"cost": {
"nb_queries": 5,
"nb_selected_queries": 5,
"nb_sentences": 2,
"nb_words": 48,
"size": 310,
"length_queries": 302,
"length_selected_queries": 302,
"nb_pages": 1,
"nb_searchable_sentences": 2
},
"privacy": {
"read": "public"
},
"profile": {
"title": "Abraham Lincoln"
},
"urls": {
"edit": "https://premium.plagium.com/admin/en/documents/id/12345678-1234-1234-1234-12345678",
"report": "https://premium.plagium.com/admin/en/report/id/12345678-1234-1234-1234-12345678",
"print": "https://premium.plagium.com/admin/en/print/report/12345678-1234-1234-1234-12345678",
"public_report": "https://premium.plagium.com/admin/en/document/report/12345678-1234-1234-1234-12345678"
}
},
"rights": {
"created": 1554868084936,
"modifiedby": "lambda",
"modified": 1554868124901,
"createdby": "api",
"ownedby": "aaaaaaaa-aaaa-aaaa-aaaaaaaa"
},
"active": true,
"import_id": "YOUR DOCUMENT ID",
"type": "document"
}
},
"results": [{
"result": {
"obj_type": "result",
"url": "https://en.wikipedia.org/wiki/Abraham_Lincoln",
"title": "Abraham Lincoln - Wikipedia",
"description": "Abraham Lincoln (February 12, 1809 – April 15, 1865) was an American statesman, politician, and lawyer who served as the 16th president of the United States from 1861 until his assassination in April 1865."
},
"score": 0.2660360339939722,
"max_page_score": 0.2660360339939722,
"max_paragraph_score": 39.4230239311529,
"max_sentence_score": 86.15384615384616,
"queries": 5,
"found": 1,
"comparison": {
"score": 80.45383729594255,
"max_page_score": 80.45383729594255,
"max_paragraph_score": 80.45383729594255,
"max_sentence_score": 80.87719298245614
},
"checked": true
},
{
"result": {
"obj_type": "result",
"url": "https://en.wikipedia.org/wiki/16th_President_of_the_United_States",
"title": "Abraham Lincoln - Wikipedia",
"description": "Abraham Lincoln (February 12, 1809 – April 15, 1865) was an American statesman, politician, and lawyer who served as the 16th president of the United States from 1861 until his assassination in April 1865."
},
"score": 0.26594427801507586,
"max_page_score": 0.26594427801507586,
"max_paragraph_score": 39.4230239311529,
"max_sentence_score": 86.15384615384616,
"queries": 5,
"found": 1,
"comparison": {
"score": 80.45383729594255,
"max_page_score": 80.45383729594255,
"max_paragraph_score": 80.45383729594255,
"max_sentence_score": 80.87719298245614
},
"checked": true
}
],
"api": {
"version": "2.0.7",
"name": "results",
"date": 1554871697745
}
}
https://api.plagium.com/v2/remaining_credits
Argument | Requis | Description |
---|---|---|
key | oui | Votre clé API. |
password | au | Votre mot de passe API s'il est défini. |
var request = require('request');
var body={
key:"YOUR API KEY"
};
request.post("https://api.plagium.com/v2/remaining_credits", { json: true, body: body },
function(err, res, body) {
if (err) console.error(err);
else console.log(body);
});
{
"data":{
"key":"YOUR API KEY",
"type":"remaining_credits"
},
"remaining_credits":{
"currency":{
"usd":86.00,
"eur":null,
"brl":null,
"inr":null},
"documents":null,
"pages":null,
"words":null,
"characters":null
},
"api":{
"version":"2.0.10",
"name":"remaining_credits",
"date":1566219132762
}
}