Text Perfector API Documentation

Plans & Pricing

Prices automatically adjust based on your region (EUR for Europe, USD for others)

Free Plan

  • 50 requests per month
  • 10 requests/minute
  • Max 5K characters
  • Basic corrections

per month

Standard Plan

  • 10,000 requests per month
  • 30 requests/minute
  • Max 10K characters
  • Translation included

per month

Premium Plan

  • Unlimited requests
  • 60 requests/minute
  • Max 50K characters
  • Priority support

per month

Getting Started

To use the Text Perfector API, you need to obtain an API key by subscribing to a plan.

Quick Start
  1. Create an account and choose a plan at textperfector.com/api/pricing
  2. Get your API key from the dashboard at textperfector.com/api/dashboard
  3. Include your API key in all requests via the X-API-Key header

Base URL

https://textperfector.com/api/v1

Authentication

All API requests must include your API key in the header:

X-API-Key: tp_your_api_key_here

Endpoints

GET /detect-region

Detect Region and Currency

Automatically detect the user's region and currency.

Response
{
    "success": true,
    "data": {
        "region": "Europe",
        "country": "France",
        "currency": "EUR",
        "symbol": "€"
    }
}
GET /plans

Get Available Plans

Get all available plans with pricing for your region.

Response
{
    "success": true,
    "data": {
        "plans": [
            {
                "id": 1,
                "name": "Free",
                "slug": "free",
                "price": 0,
                "currency": "EUR",
                "requests_per_month": 50,
                "rate_limit_per_minute": 10
            }
        ],
        "region": { "currency": "EUR", "symbol": "€" }
    }
}
POST /correct

Correct Text

Send text to be corrected with AI-powered grammar and spelling correction.

Headers
X-API-Key: tp_your_api_key_here
Content-Type: application/json
Request Body
{
    "text": "Your text to be corrected",
    "language": "en",  // Optional: auto-detected if not provided
    "correction_level": "standard"  // basic, standard, or advanced
}
Response
{
    "success": true,
    "data": {
        "original_text": "Your text to be corrected",
        "corrected_text": "Your corrected text.",
        "language_detected": "en",
        "correction_level": "standard",
        "changes_count": 1
    }
}
POST /translate

Translate Text

Translate text between languages (Standard and Premium plans only).

Headers
X-API-Key: tp_your_api_key_here
Content-Type: application/json
Request Body
{
    "text": "Hello, how are you?",
    "target_language": "fr",  // Target language code
    "source_language": "en"  // Optional: auto-detected if not provided
}
Response
{
    "success": true,
    "data": {
        "original_text": "Hello, how are you?",
        "translated_text": "Bonjour, comment allez-vous ?",
        "source_language": "en",
        "target_language": "fr"
    }
}
GET /usage

Check API Usage

Get your current API usage statistics and subscription details.

Headers
X-API-Key: tp_your_api_key_here
Response
{
    "success": true,
    "data": {
        "subscription": {
            "plan": "standard",
            "status": "active",
            "requests_used": 234,
            "requests_limit": 5000,
            "remaining_requests": 4766,
            "usage_percentage": 4.68,
            "current_period_start": "2025-12-01",
            "current_period_end": "2025-12-31"
        }
    }
}

Code Examples

cURL

# Get available plans
curl https://textperfector.com/api/v1/plans

# Correct text
curl -X POST https://textperfector.com/api/v1/correct \
  -H "Content-Type: application/json" \
  -H "X-API-Key: tp_your_api_key" \
  -d '{
    "text": "Your text to be corrected",
    "language": "en",
    "correction_level": "standard"
  }'

# Translate text
curl -X POST https://textperfector.com/api/v1/translate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: tp_your_api_key" \
  -d '{
    "text": "Hello world",
    "target_language": "fr"
  }'

# Check usage
curl https://textperfector.com/api/v1/usage \
  -H "X-API-Key: tp_your_api_key"

Python

import requests

API_KEY = 'tp_your_api_key'
BASE_URL = 'https://textperfector.com/api/v1'

class TextPerfectorAPI:
    def __init__(self, api_key):
        self.api_key = api_key
        self.headers = {
            'X-API-Key': api_key,
            'Content-Type': 'application/json'
        }
    
    def correct_text(self, text, language='en', correction_level='standard'):
        response = requests.post(
            f'{BASE_URL}/correct',
            headers=self.headers,
            json={
                'text': text,
                'language': language,
                'correction_level': correction_level
            }
        )
        return response.json()
    
    def translate_text(self, text, target_language, source_language=None):
        response = requests.post(
            f'{BASE_URL}/translate',
            headers=self.headers,
            json={
                'text': text,
                'target_language': target_language,
                'source_language': source_language
            }
        )
        return response.json()
    
    def get_usage(self):
        response = requests.get(
            f'{BASE_URL}/usage',
            headers=self.headers
        )
        return response.json()

# Example usage
api = TextPerfectorAPI(API_KEY)

# Correct text
result = api.correct_text("Text to be corrected")
if result['success']:
    print(result['data']['corrected_text'])

# Check usage
usage = api.get_usage()
print(f"Used: {usage['data']['subscription']['requests_used']} / {usage['data']['subscription']['requests_limit']}")

JavaScript/Node.js

const API_KEY = 'tp_your_api_key';
const BASE_URL = 'https://textperfector.com/api/v1';

class TextPerfectorAPI {
    constructor(apiKey) {
        this.apiKey = apiKey;
        this.headers = {
            'X-API-Key': apiKey,
            'Content-Type': 'application/json'
        };
    }
    
    async correctText(text, language = 'en', correctionLevel = 'standard') {
        const response = await fetch(`${BASE_URL}/correct`, {
            method: 'POST',
            headers: this.headers,
            body: JSON.stringify({
                text,
                language,
                correction_level: correctionLevel
            })
        });
        return response.json();
    }
    
    async translateText(text, targetLanguage, sourceLanguage = null) {
        const response = await fetch(`${BASE_URL}/translate`, {
            method: 'POST',
            headers: this.headers,
            body: JSON.stringify({
                text,
                target_language: targetLanguage,
                source_language: sourceLanguage
            })
        });
        return response.json();
    }
    
    async getUsage() {
        const response = await fetch(`${BASE_URL}/usage`, {
            headers: this.headers
        });
        return response.json();
    }
}

// Example usage
const api = new TextPerfectorAPI(API_KEY);

// Correct text
api.correctText("Text to be corrected")
    .then(result => {
        if (result.success) {
            console.log(result.data.corrected_text);
        }
    })
    .catch(error => console.error('Error:', error));

// Check usage
api.getUsage()
    .then(usage => {
        const sub = usage.data.subscription;
        console.log(`Used: ${sub.requests_used} / ${sub.requests_limit}`);
    });

Rate Limits

Plan Monthly Requests Requests per Minute Max Text Length
Free 50 10 5,000 characters
Standard 10,000 30 10,000 characters
Premium Unlimited 60 50,000 characters
Error Responses
  • 429 Too Many Requests: You've exceeded your rate limit
  • 403 Forbidden: Quota exceeded or subscription inactive
  • 401 Unauthorized: Invalid or missing API key

Support

If you need any help or have questions about the API, please contact us at [email protected]