# Cross-Language Detection

> Detect translated plagiarism with the Copyleaks API - find content copied from another language across 9 source and 30+ target languages.

The Copyleaks Cross-Language Detection is a powerful feature that enables you to identify plagiarism across different languages. It can detect content that has been translated from one language to another, helping catch sophisticated plagiarism attempts where text is copied, translated, and presented as original work.

This guide will walk you through the process of using Cross-Language Detection and understanding its capabilities.

## Overview

Cross-Language Detection identifies content that has been translated from one language to another. For example, if someone takes content written in English, translates it to Spanish, and presents it as original work, Cross-Language Detection can identify this plagiarism attempt.

<CardGroup cols={2}>
  <Card title="Supported Languages" icon="language" href="/reference/actions/miscellaneous/supported-cross-languages">View the complete list of supported source and result languages for cross-language detection.</Card>
  <Card title="Submit for Analysis" icon="paper-plane" href="/reference/actions/authenticity/overview">Learn how to submit content for plagiarism detection including cross-language detection.</Card>
</CardGroup>

## How It Works

Cross-Language Detection uses advanced translation and semantic matching technology to:

1. **Analyze Source Document**: The system processes your submitted document in its original language.

2. **Translation Analysis**: The content is analyzed across different language databases.

3. **Semantic Matching**: Beyond direct translation, the system looks for semantic similarities that might indicate translated plagiarism.

4. **Results Compilation**: Findings are compiled into a comprehensive report that identifies potential matches across languages.

## Key Benefits

- **Catch Sophisticated Plagiarism**: Identify plagiarism attempts that involve translation, which traditional [plagiarism checkers](https://copyleaks.com/plagiarism-checker) would miss.
- **Multi-Language Support**: Support for multiple source languages and an even wider range of result languages.
- **Seamless Integration**: Use the same API workflow as regular plagiarism checks with additional parameters.
- **Detailed Reporting**: Get precise information about cross-language matches with the same detailed reporting as standard plagiarism detection.

## Get Started

<Steps>
  <Step title="Before you begin">
    Before you start, ensure you have the following:
    - An active Copyleaks account. If you don't have one, **[sign up for free](https://api.copyleaks.com/signup)**.
    - You can find your API key on the **[API Dashboard](https://api.copyleaks.com/dashboard)**.
  </Step>

  <Step title="Installation">
    <InstallSDKs />
  </Step>

  <Step title="Login">
    To perform a scan, we first need to generate an access token. For that, we will use the [**login**](/reference/actions/account/login) endpoint.
    The API key can be found on the [**Copyleaks API Dashboard**](https://api.copyleaks.com/dashboard).

    Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the `Authorization: Bearer <TOKEN>` header.
    This token remains valid for 48 hours.

    <CodeGroup>
        ```http title="HTTP" icon="globe"
        POST https://id.copyleaks.com/v3/account/login/api

        Headers
        Content-Type: application/json

        Body
        {
            "email": "your@email.address",
            "key": "00000000-0000-0000-0000-000000000000"
        }
        ```
        ```bash title="cURL" icon="terminal"
        export COPYLEAKS_EMAIL="your@email.address"
        export COPYLEAKS_API_KEY="your-api-key-here"

        curl --request POST \
          --url https://id.copyleaks.com/v3/account/login/api \
          --header 'Accept: application/json' \
          --header 'Content-Type: application/json' \
          --data "{
            \"email\": \"${COPYLEAKS_EMAIL}\",
            \"key\": \"${COPYLEAKS_API_KEY}\"
          }"
        ```
        ```python title="Python" icon="python"
        from copyleaks.copyleaks import Copyleaks

        EMAIL_ADDRESS = "your@email.address"
        API_KEY = "your-api-key-here"

        # Login to Copyleaks
        auth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY)
        print("Logged successfully!\nToken:", auth_token)
        ```
        ```javascript title="JavaScript" icon="square-js"
        const { Copyleaks } = require("plagiarism-checker");

        const EMAIL_ADDRESS = "your@email.address";
        const API_KEY = "your-api-key-here";
        const copyleaks = new Copyleaks();

        // Login function
        function loginToCopyleaks() {
          return copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY).then(
            (loginResult) => {
              console.log("Login successful!");
              console.log("Access Token:", loginResult.access_token);
              return loginResult;
            },
            (err) => {
              console.error('Login failed:', err);
              throw err;
            }
          );
        }

        loginToCopyleaks();
        ```
        ```java title="Java" icon="java"
        import com.copyleaks.sdk.api.Copyleaks;

        String EMAIL_ADDRESS = "your@email.address";
        String API_KEY = "00000000-0000-0000-0000-000000000000";

        // Login to Copyleaks
        try {
            String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY);
            System.out.println("Logged successfully!\nToken: " + authToken);
        } catch (CommandException e) {
            System.out.println("Failed to login: " + e.getMessage());
            System.exit(1);
        }
        ```
    </CodeGroup>

    **Response**
    ```json
    {
        "access_token": "<ACCESS_TOKEN>",
        ".issued": "2025-07-31T10:19:40.0690015Z",
        ".expires": "2025-08-02T10:19:40.0690016Z"
    }
    ```

    <Note>
    Save this token! It's valid for 48 hours and can be reused for subsequent API calls.
    </Note>
  </Step>

  <Step title="Submit for Cross-Language Analysis">
    <SubmissionMethods />
    
    For this guide, we'll demonstrate document submission for cross-language detection. Each submission requires a unique `scanId` for proper tracking and identification.

    <Tip>
    For testing, set `"sandbox": true`. Sandbox mode is free and returns mock results.
    </Tip>

    <CodeGroup>
      ```http title="HTTP" icon="globe"
      POST https://api.copyleaks.com/v3/scans/submit/file/{scanId}
      Content-type: multipart/form-data
      Authorization: Bearer YOUR_LOGIN_TOKEN
      
      Request Body:
      {
        "base64": "<BASE64_ENCODED_FILE>",
        "filename": "my-document.pdf",
        "properties": {
          "sandbox": true,
          "scanning": {
            "crossLanguages": {
              "languages": [
                { "code": "es" },
                { "code": "fr" }
              ]
            }
          }
        }
      }
      ```
      ```bash title="cURL" icon="terminal"
      curl -X POST "https://api.copyleaks.com/v3/scans/submit/file/my-scan-123" \
           -H "Authorization: Bearer <YOUR_AUTH_TOKEN>" \
           -H "Content-Type: multipart/form-data" \
           -F "file=@my-document.pdf" \
           -F 'properties={
               "sandbox": true,
               "scanning": {
                 "crossLanguages": {
                   "languages": [
                      { "code": "es" },
                      { "code": "fr" }
                   ]
                 }
               }
             }'
      ```
      ```python title="Python" icon="python"
      from copyleaks.copyleaks import Copyleaks
      from copyleaks.models.submit.document import FileDocument
      from copyleaks.models.submit.properties.scan_properties import ScanProperties
      
      scan_id = "my-scan-123"
      file_path = "my-document.pdf"
      
      # Create document to scan
      file_submission = FileDocument(file_path)
      file_submission.set_sandbox(True)
      
      # Configure cross-language detection
      properties = ScanProperties()
      properties.set_scanning_cross_languages(["es", "fr"])  # Spanish and French
      file_submission.set_properties(properties)
      
      # Submit for scanning
      response = Copyleaks.submit_file(auth_token, scan_id, file_submission)
      print(response)
      ```
      ```javascript title="JavaScript" icon="square-js"
      const { Copyleaks, CopyleaksFileSubmissionModel } = require('plagiarism-checker');
      
      async function submitWithCrossLanguage() {
          try {
              // Initialize Copyleaks
              const copyleaks = new Copyleaks();
              
              // Login to get the authentication token
              const loginResult = await copyleaks.loginAsync('YOUR_EMAIL@example.com', 'YOUR_API_KEY');
              
              const scanId = `cross-lang-scan-${Date.now()}`;
              
              // Create a file submission model
              const fileToSubmit = './my-document.pdf';
              const submission = new CopyleaksFileSubmissionModel(fileToSubmit);
              submission.sandbox = true;
              
              // Set cross language properties
              submission.properties = {
                  scanning: {
                      crossLanguages: {
                          languages: [
                              { code: "es" },
                              { code: "fr" }
                          ]
                      }
                  }
              };
              
              // Submit the file for scanning
              const response = await copyleaks.submitFileAsync(loginResult, scanId, submission);
              console.log("Submission successful:", response);
              
          } catch (error) {
              console.error("An error occurred:", error);
          }
      }
      
      submitWithCrossLanguage();
      ```
    </CodeGroup>
  </Step>
</Steps>

## Supported Languages

Cross-Language Detection supports a wide range of languages:

- **Source Languages**: The document you upload can be in one of the supported source languages (Danish, Dutch, English, French, German, Italian, Portuguese, Russian, Spanish).

- **Result Languages**: Copyleaks can detect plagiarism in over 30 target languages, including Albanian, Bulgarian, Chinese, Czech, German, Greek, Hindi, Japanese, Korean, and many more.

<Tip>
  The list of supported languages is continually expanding. For the most up-to-date list, use the [Supported Cross-Languages API](/reference/actions/miscellaneous/supported-cross-languages).
</Tip>

## Pricing

Cross-Language Detection uses additional credits based on the following model:

1. **Base Scan**: The base scan in the document's original language counts as normal (1 credit per 250 words).

2. **Additional Languages**: Each additional language selected for cross-language detection will incur the same credit cost as the base scan.

For example, if your document is 1,000 words (4 credits) and you select two additional languages for cross-language detection (Spanish and French), the total cost would be:
- Base scan: 4 credits
- Spanish: 4 credits
- French: 4 credits
- Total: 12 credits

<Note>
  For precise credit calculation, use the [Price Check Before Scan](/concepts/management/manage-your-credits#price-check-before-scan) feature to get an exact quote before proceeding with the scan.
</Note>

## Use Cases

Cross-Language Detection is particularly valuable in several scenarios:

- **Academic Institutions**: Universities with international student bodies can detect plagiarism regardless of the original content's language.

- **Global Publishing**: Publishers that operate in multiple regions can ensure content originality across language barriers.

- **Research Verification**: Researchers can verify the originality of work when citing sources from different languages.

- **Content Licensing**: Media companies can protect their intellectual property from unauthorized translations.

## Best Practices

To maximize the effectiveness of Cross-Language Detection:

1. **Select Relevant Languages**: Choose only the languages that are relevant to your use case to optimize credit usage.

2. **Use with Regular Plagiarism Detection**: Cross-Language Detection works best as a complement to standard plagiarism detection.

3. **Review Results Carefully**: Because translation can alter sentence structure and word choice, review cross-language matches with special attention to semantic similarity rather than exact matches.

## Frequently asked questions

### What is cross-language plagiarism detection?

It identifies content that was copied from one language, translated into another, and presented as original - for example English text translated to Spanish. Standard same-language plagiarism checks miss this; cross-language detection catches it using translation and semantic matching.

### Which source languages are supported?

You can upload documents in Danish, Dutch, English, French, German, Italian, Portuguese, Russian, and Spanish. The list keeps expanding - see the [Supported Cross-Languages API](/reference/actions/miscellaneous/supported-cross-languages) for the current list.

### How many target languages can it match against?

Copyleaks can detect translated plagiarism in over 30 target languages, including Albanian, Bulgarian, Chinese, Czech, Greek, Hindi, Japanese, and Korean.

### How do I enable cross-language detection?

Add a `scanning.crossLanguages.languages` array of language codes to the submission `properties` (for example `[{ "code": "es" }, { "code": "fr" }]`). It uses the same submission workflow as a standard plagiarism scan.

### Does cross-language detection cost extra credits?

Yes. The base scan costs the normal 1 credit per 250 words, and each additional language you select costs the same as the base scan. Use [Price Check Before Scan](/concepts/management/manage-your-credits#price-check-before-scan) for an exact quote.
