API v2

https://api.plagium.com/v2/document
ArgumentRequiredDescription
keyyesYour API Key
passwordnoYour API password if set
data.textyesText
data.titlenoDocument title
data.descriptionnoDocument description
data.authornoDocument author
data.keywordsnoDocument keywords
data.sourcenoScope of the search.
Possible values:
web: search over the web
file: compare with my documents
Default is: [“web”].
data.typenoSearch type. Possible values:
quick: for a quick search (only available with data.source=web)
deep: for a deep search
Default is: “deep”.
data.url_filternoDomain or urls to be excluded from results separated by space or line feed.
data.import_idnoThe id of your document for consolidation usage
data.min_ranknoMinimum amount percentage (0 to 100) of common meaningful words between two sentences.
Default is: 45.0.
data.min_relationnoMinimum similarity (0.0 to 1.0) between two sentences. Default is: 0.4.
data.webhook.urlnoThe webhook will make an HTTP POST request to your app with information about your search.
data.webhook.formatnoWebhook data format. Possible values:
simple: only send search and cost information
document: send information about document, search, and cost
Default is: simple.
data.webhook.metadatanoWebhook metadata. User data, can be anything JSON object. Metadata is returned with the webhook callback.
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);
    }
});

Use body.obj._id for future references.

{
"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
ArgumentRequiredDescription
keyyesYour API Key.
passwordnoYour API password if set.
data.idyesThe id of your document: the _id field.
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
ArgumentRequiredDescription
keyyesYour API Key.
passwordnoYour API password if set.
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
}
}

Comment pouvons nous aider?