Documentation

Everything you need to use MOSS Checker - Web UI, API, and Code Examples

🚀 Getting Started

1. Create Your Account

Sign up for a free account and get 10 complimentary checks. No credit card required!

Create Free Account →

2. Get Your API Key

  1. Navigate to Dashboard → API Keys
  2. Click "Generate New API Key"
  3. Copy and save your key securely
  4. Use it in all API requests

3. Choose Your Method

Web Interface
Perfect for teachers and one-time checks. No coding required.
REST API
Ideal for developers building automated workflows.
Command Line
Great for scripts and CI/CD pipelines.

📱 Usage Methods

Method 1: Web Interface (Easiest)

Perfect for teachers and one-time plagiarism checks. No coding knowledge required!

Features:

  • Drag & drop file upload
  • Canvas LMS export support (automatic student detection)
  • Visual results dashboard with percentages
  • Click to view side-by-side comparisons
  • Download reports

How to Use:

2
Select programming language
3
Upload files (ZIP or individual files)
4
Click "Run MOSS Check" and wait for results
5
View results with similarity percentages

Method 2: REST API (Most Powerful)

Ideal for developers building automated workflows, batch processing, or integrations.

Features:

  • Programmatic access to MOSS detection
  • Batch processing multiple submissions
  • Integration with your existing systems
  • Automated CI/CD pipeline integration
  • Custom workflows and reporting

Quick Example:

# Submit a plagiarism check
curl -X POST https://mosschecker.com/api/v1/check \
  -H "X-API-Key: moss_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "language": "python",
    "files": [
      {"name": "student1.py", "content": "..."},
      {"name": "student2.py", "content": "..."}
    ]
  }'

Method 3: Command Line (For Scripts)

Great for quick checks, automation scripts, and CI/CD pipelines.

Example with cURL:

# Check two Python files
curl -X POST https://mosschecker.com/api/v1/check \
  -H "X-API-Key: $MOSS_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$(jq -n \
    --arg lang "python" \
    --arg file1 "$(base64 student1.py)" \
    --arg file2 "$(base64 student2.py)" \
    '{language: $lang, files: [{name: "student1.py", content: $file1}, {name: "student2.py", content: $file2}]}'
  )"

Example Shell Script:

#!/bin/bash
API_KEY="moss_your_api_key"
LANGUAGE="python"

# Submit check
RESULT=$(curl -s -X POST https://mosschecker.com/api/v1/check \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d @payload.json)

echo "$RESULT"

🔌 API Endpoints

Authentication

All API requests require authentication. Include your API key in one of two ways:

Option 1: X-API-Key Header (Recommended)

X-API-Key: moss_your_api_key_here

Option 2: Bearer Token

Authorization: Bearer moss_your_api_key_here
POST

/api/v1/check

Submit files for plagiarism detection

Request Body:

{
  "language": "python", // Required: Programming language
  "files": [ // Required: Array of at least 2 files
    {
      "name": "student1.py", // Required: File name
      "content": "<base64_encoded_content>" // Required: Base64 encoded file content
    },
    {
      "name": "student2.py",
      "content": "<base64_encoded_content>"
    }
  ]
}

Response (Success):

{
  "id": 12345, // Check ID for retrieving results
  "status": "completed",
  "result_url": "https://...", // URL to MOSS results
  "matches_found": 5 // Number of potential matches
}
GET

/api/v1/check/{id}

Get the status of a specific check

Response:

{
  "id": 12345,
  "status": "completed", // processing, completed, or failed
  "language": "python",
  "files_count": 10,
  "matches_found": 5,
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:31:45Z"
}
GET

/api/v1/check/{id}/results

Get detailed results including all matches

Response:

{
  "id": 12345,
  "status": "completed",
  "result_url": "https://...",
  "matches_found": 5,
  "results": {
    "matches": [
      {
        "file1": "student1.py",
        "file2": "student2.py",
        "file1_percent": 85,
        "file2_percent": 78,
        "url": "https://..."
      }
    ]
  }
}
GET

/api/v1/languages

Get list of all supported programming languages

Response:

{
  "languages": {
    "python": "Python",
    "java": "Java",
    "javascript": "JavaScript",
    // ... more languages
  }
}
GET

/api/v1/usage

Get your current usage statistics and limits

Response:

{
  "plan": "pure",
  "checks_today": 15,
  "checks_this_month": 234,
  "limits": {
    "daily_limit": 50,
    "storage_days": 7
  }
}

💻 Code Examples

Python

Popular

Using requests library:

import requests
import base64
import json

# Configuration
API_KEY = "moss_your_api_key"
BASE_URL = "https://mosschecker.com/api/v1"

# Read and encode files
def encode_file(filepath):
    with open(filepath, "rb") as f:
        return base64.b64encode(f.read()).decode("utf-8")

# Submit plagiarism check
def check_plagiarism(language, files):
    response = requests.post(
        f"{BASE_URL}/check",
        headers={"X-API-Key": API_KEY},
        json={
            "language": language,
            "files": files
        }
    )
    return response.json()

# Example usage
files = [
    {"name": "student1.py", "content": encode_file("student1.py")},
    {"name": "student2.py", "content": encode_file("student2.py")}
]

result = check_plagiarism("python", files)
print(f"Check ID: {result['id']}")
print(f"Matches found: {result['matches_found']}")
print(f"Results: {result['result_url']}")

JavaScript / Node.js

Using axios:

const axios = require('axios');
const fs = require('fs');

// Configuration
const API_KEY = 'moss_your_api_key';
const BASE_URL = 'https://mosschecker.com/api/v1';

// Encode file to base64
function encodeFile(filePath) {
  const fileContent = fs.readFileSync(filePath);
  return fileContent.toString('base64');
}

// Submit plagiarism check
async function checkPlagiarism(language, files) {
  try {
    const response = await axios.post(`${BASE_URL}/check`, {
      language,
      files
    }, {
      headers: { 'X-API-Key': API_KEY }
    });
    return response.data;
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
    throw error;
  }
}

// Example usage
(async () => {
  const files = [
    { name: 'student1.js', content: encodeFile('student1.js') },
    { name: 'student2.js', content: encodeFile('student2.js') }
  ];

  const result = await checkPlagiarism('javascript', files);
  console.log(`Check ID: ${result.id}`);
  console.log(`Matches found: ${result.matches_found}`);
  console.log(`Results: ${result.result_url}`);
})();

PHP

Using cURL:

<?php

// Configuration
$apiKey = 'moss_your_api_key';
$baseUrl = 'https://mosschecker.com/api/v1';

// Function to encode file
function encodeFile($filePath) {
    return base64_encode(file_get_contents($filePath));
}

// Submit plagiarism check
function checkPlagiarism($apiKey, $language, $files) {
    global $baseUrl;
    
    $ch = curl_init("{$baseUrl}/check");
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'X-API-Key: ' . $apiKey,
        'Content-Type: application/json'
    ]);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
        'language' => $language,
        'files' => $files
    ]));
    
    $response = curl_exec($ch);
    curl_close($ch);
    
    return json_decode($response, true);
}

// Example usage
$files = [
    ['name' => 'student1.php', 'content' => encodeFile('student1.php')],
    ['name' => 'student2.php', 'content' => encodeFile('student2.php')]
];

$result = checkPlagiarism($apiKey, 'php', $files);
echo "Check ID: {$result['id']}\n";
echo "Matches: {$result['matches_found']}\n";

?>

Ruby

Using net/http:

require 'net/http'
require 'json'
require 'base64'

# Configuration
API_KEY = 'moss_your_api_key'
BASE_URL = 'https://mosschecker.com/api/v1'

# Encode file to base64
def encode_file(filepath)
  Base64.strict_encode64(File.read(filepath))
end

# Submit plagiarism check
def check_plagiarism(language, files)
  uri = URI("#{BASE_URL}/check")
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri)
  request['X-API-Key'] = API_KEY
  request['Content-Type'] = 'application/json'
  request.body = { language: language, files: files }.to_json

  response = http.request(request)
  JSON.parse(response.body)
end

# Example usage
files = [
  { name: 'student1.rb', content: encode_file('student1.rb') },
  { name: 'student2.rb', content: encode_file('student2.rb') }
]

result = check_plagiarism('ruby', files)
puts "Check ID: #{result['id']}"
puts "Matches: #{result['matches_found']}"

Java

Using HttpClient:

import java.net.http.*;
import java.net.*;
import java.util.*;
import java.nio.file.*;

public class MossChecker {
    private static final String API_KEY = "moss_your_api_key";
    private static final String BASE_URL = "https://mosschecker.com/api/v1";

    public static String checkPlagiarism(String language, List<Map<String, String>> files) {
        try {
            HttpClient client = HttpClient.newHttpClient();

            String json = String.format(
                "{\"language\":\"%s\",\"files\":%s}",
                language,
                /* files as JSON */
            );

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(BASE_URL + "/check"))
                .header("X-API-Key", API_KEY)
                .header("Content-Type", "application/json")
                .POST(HttpRequest.BodyPublishers.ofString(json))
                .build();

            HttpResponse<String> response = client.send(request,
                HttpResponse.BodyHandlers.ofString());

            return response.body();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}

cURL (Command Line)

Basic Example:

# Submit a check
curl -X POST https://mosschecker.com/api/v1/check \
  -H "X-API-Key: moss_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "language": "python",
    "files": [
      {
        "name": "student1.py",
        "content": "'"$(base64 -w0 student1.py)"'"
      },
      {
        "name": "student2.py",
        "content": "'"$(base64 -w0 student2.py)"'"
      }
    ]
  }'

Get Check Status:

curl -X GET https://mosschecker.com/api/v1/check/12345 \
  -H "X-API-Key: moss_your_api_key"

🌐 Supported Languages

MOSS Checker supports 40+ programming languages for plagiarism detection:

C
c
C++
cc
C++
cpp
C#
csharp
Java
java
JavaScript
javascript
TypeScript
typescript
Python
python
Ruby
ruby
PHP
php
Go
go
Rust
rust
Swift
swift
Kotlin
kotlin
Scala
scala
Perl
perl
Haskell
haskell
ML
ml
OCaml
ocaml
Lisp
lisp
Scheme
scheme
Prolog
prolog
Fortran
fortran
Pascal
pascal
Ada
ada
MATLAB
matlab
R
r
SQL
sql
PL/SQL
plsql
VHDL
vhdl
Verilog
verilog
Visual Basic
vb
Assembly
assembly
MIPS
mips
8086 Assembly
a8086
Plain Text
ascii
Text
text
Lua
lua
TCL
tcl

💡 Tip: Use the language code (e.g., python) when making API requests.

Advanced Topics

Rate Limits & Plans

Plan Price Daily Limit Storage
Free $0 10 total checks None
Pure Unlimited $20/month 50 checks/day 7 days
Ultimate Unlimited $100/month 500 checks/day 30 days
Enterprise Unlimited $1000/month Unlimited Forever

Best Practices

Use Batch Processing

Submit all student files in a single API call rather than making multiple requests.

Choose the Right Language

Always specify the exact programming language for better accuracy.

Handle Errors Gracefully

Implement retry logic for network failures and check for rate limit errors (HTTP 429).

Store Results Locally

Save the results URL and data since result storage is time-limited based on your plan.

Use Canvas Integration

If you're a teacher using Canvas LMS, upload the submission export ZIP directly for automatic student detection.

Error Handling

Common HTTP status codes:

400
Bad Request - Invalid parameters or missing required fields
401
Unauthorized - Invalid or missing API key
429
Too Many Requests - Rate limit exceeded, wait before retrying
500
Server Error - Something went wrong, contact support if persistent

Need Help?

Our support team is here to help you get the most out of MOSS Checker. Whether you need integration assistance or have questions about your results, we're just a message away.