Copyleaks SDK is a simple framework that allows you to perform plagiarism scans and track content distribution around the web, using Copyleaks cloud.
With Copyleaks SDK you can submit for scan:
- Webpages
- Local files (see supported files here)
- OCR (Optical Character Recognition) - scanning pictures containing textual content (see supported files here)
You can configure Copyleaks SDK in one of two ways:
- Download the code from here, compile it and add reference to the assembly.
- Add CopyleaksAPI NuGet by running the following command in the Package Manager Console
Install-Package CopyleaksAPI
To use Copyleaks API you need to be a registered user. Signing up is free of charge.
Signup to Copyleaks and confirm your account by clicking the link on the confirmation email. To get your API key, click your username in the upper right corner which will lead you to ‘Manage Account’ page. Press on "Generate" to get your own personal API key.
For more information check out our API guide.
This code will show you where the textual content in the parameter ‘url’ has been used online:
using System; using System.Threading; using Copyleaks.SDK.API; // ...private static void Scan(string username, string apiKey, string url) { Console.Write("User login... "); LoginToken token = UsersAuthentication.Login(username, apiKey);// Login to Copyleaks server. This security token can be use multiple times, untill it will be expired (14 days). Console.WriteLine("\t\t\tSuccess!");
Console.Write("Submiting new request... "); Detector detector = new Detector(token); ScannerProcess process = detector.CreateByUrl(new Uri(url));// Create a new process on server. Console.WriteLine("\tSuccess!"); Console.Write("Waiting for completion... "); while (!process.IsCompleted()) Thread.Sleep(1000);// Waiting to process to be finished. Console.WriteLine("\tSuccess!"); Console.Write("Getting results... "); var results = process.GetResults();// Getting results. if (results.Length == 0) { Console.WriteLine("\tNo results."); } else { for (int i = 0; i < results.Length; ++i) { Console.WriteLine(); Console.WriteLine("Result {0}:", i + 1); Console.WriteLine("Url: {0}", results[i].URL); Console.WriteLine("Precents: {0}", results[i].Precents); Console.WriteLine("CopiedWords: {0}", results[i].NumberOfCopiedWords); } }
}