- An active Copyleaks account. If you don’t have one, sign up for free.
- You can find your API key on the API Dashboard.
- Go 1.22 or later. The SDK has no dependencies outside the standard library.
Get Started
1
Installation
Add the official
copyleaks-go module to your project.2
Quick Example: Scan Text
main.go
3
Understanding the Code
The example code performs four main actions to submit a scan:
- Create a client:
copyleaks.NewClient()creates the client that sends every request. Every method takes acontext.Contextfirst. - Login: It authenticates with your email and API key to get a login token, which is required for all subsequent requests.
- Configure Scan: It fills a
FileSubmissionwith the content, a filename andScanProperties. We enableSandboxmode for safe testing and provide the webhook URL. The SDK encodesContentto Base64 for you. - Submit for Scanning:
SubmitFilesends the submission to the Copyleaks API. The process is asynchronous; Copyleaks will notify your webhook URL once the scan is complete.
Next Steps
GitHub Repository
Check the official Copyleaks Go SDK repository on GitHub for more examples and details.
Go Package Reference
Browse every type and method of the SDK on pkg.go.dev.
Check for Plagiarism
Detect plagiarism in text documents using the Copyleaks API. Search billions of sources to find unoriginal content.
Detect AI-Generated Content
Detect AI-generated text via sync or async API calls. This guide covers sync detection, see the Authenticity API Guide for async.
Assess Grammar and Writing Quality
Get writing and grammar suggestions via API. Authenticate, submit text, and access full details in the docs.
Moderate Text
Scan and moderate text content for unsafe or policy-relevant material across 10+ categories.

