Skip to main content
Complete reference for all Text Utilities API endpoints, parameters, and response formats.

Base URL

https://api.sinaty.business/text/

Endpoints Overview

MethodEndpointDescription
GET/text/Process text with query parameters
POST/text/Process text with JSON body

GET /text/

Process text using query parameters.

Query Parameters

ParameterTypeDefaultDescription
textstringrequiredText to process
operationstringanalyzeOperation to perform
formatstringjsonOutput format (json/text)

Supported Operations

Text Analysis

OperationDescriptionExample InputExample Output
analyzeComprehensive text analysis”Hello World”JSON with detailed statistics
lengthGet character count”Hello”5
word_countCount words”Hello World”2
line_countCount lines”Line 1\nLine 2”2

Case Transformations

OperationDescriptionExample InputExample Output
uppercaseConvert to UPPERCASE”hello world""HELLO WORLD”
lowercaseConvert to lowercase”HELLO WORLD""hello world”
titlecaseConvert to Title Case”hello world""Hello World”
camelcaseConvert to camelCase”hello world""helloWorld”
pascalcaseConvert to PascalCase”hello world""HelloWorld”
snakecaseConvert to snake_case”Hello World""hello_world”
kebabcaseConvert to kebab-case”Hello World""hello-world”

Text Manipulation

OperationDescriptionExample InputExample Output
reverseReverse entire text”hello""olleh”
reverse_wordsReverse word order”hello world""world hello”
remove_spacesRemove all spaces”hello world""helloworld”
remove_duplicatesRemove duplicate characters”hello""helo”
remove_duplicate_wordsRemove duplicate words”hello world hello""hello world”

Encoding/Decoding

OperationDescriptionExample InputExample Output
base64_encodeEncode to Base64”hello""aGVsbG8=“
base64_decodeDecode from Base64”aGVsbG8=""hello”
url_encodeURL encode text”hello world""hello%20world”
url_decodeURL decode text”hello%20world""hello world”
html_encodeEncode HTML entities”<hello>""<hello>“
html_decodeDecode HTML entities”<hello>""<hello>“

Cipher Operations

OperationDescriptionExample InputExample Output
rot13Apply ROT13 cipher”hello""uryyb”
caesar_cipherApply Caesar cipher”hello” (shift=3)“khoor”

Example Request

curl "https://api.sinaty.business/text/?text=Hello World&operation=analyze"

Response Format

{
    "original_text": "Hello World",
    "operation": "analyze",
    "analysis": {
        "length": 11,
        "word_count": 2,
        "line_count": 1,
        "character_frequency": {
            "H": 1, "e": 1, "l": 3, "o": 2, " ": 1, "W": 1, "r": 1, "d": 1
        },
        "word_frequency": {
            "Hello": 1, "World": 1
        },
        "uppercase_count": 2,
        "lowercase_count": 7,
        "digit_count": 0,
        "space_count": 1,
        "punctuation_count": 0
    }
}

POST /text/

Process text using JSON body parameters.

Request Body

{
    "text": "Hello World",
    "operation": "camelcase",
    "format": "json"
}

Example Request

curl -X POST "https://api.sinaty.business/text/" \
  -H "Content-Type: application/json" \
  -d '{"text": "hello world", "operation": "camelcase"}'

Response Fields

Analysis Response (operation=analyze)

FieldTypeDescription
original_textstringOriginal input text
operationstringOperation performed
analysis.lengthintegerTotal character count
analysis.word_countintegerNumber of words
analysis.line_countintegerNumber of lines
analysis.character_frequencyobjectFrequency of each character
analysis.word_frequencyobjectFrequency of each word
analysis.uppercase_countintegerNumber of uppercase characters
analysis.lowercase_countintegerNumber of lowercase characters
analysis.digit_countintegerNumber of digits
analysis.space_countintegerNumber of spaces
analysis.punctuation_countintegerNumber of punctuation marks

Simple Response (other operations)

FieldTypeDescription
original_textstringOriginal input text
operationstringOperation performed
resultstringProcessed text result

Error Responses

Missing Text (400)

{
    "error": "Text parameter is required",
    "details": "Please provide the 'text' parameter"
}

Invalid Operation (400)

{
    "error": "Invalid operation specified",
    "details": "Supported operations: analyze, uppercase, lowercase, titlecase, camelcase, pascalcase, snakecase, kebabcase, reverse, reverse_words, remove_spaces, remove_duplicates, remove_duplicate_words, base64_encode, base64_decode, url_encode, url_decode, html_encode, html_decode, rot13, caesar_cipher"
}

Invalid Format (400)

{
    "error": "Invalid format specified",
    "details": "Supported formats: json, text"
}

Decoding Error (400)

{
    "error": "Failed to decode input",
    "details": "Invalid Base64 string provided"
}

HTTP Status Codes

CodeDescription
200Success - Text processed
400Bad Request - Invalid parameters
500Internal Server Error

Rate Limits

No rate limits! You can make unlimited requests to our API.

Operation Details

Text Analysis

The analyze operation provides comprehensive text statistics:
  • Character Analysis: Counts each character occurrence
  • Word Analysis: Splits by whitespace and counts word frequency
  • Case Analysis: Distinguishes between uppercase and lowercase
  • Content Analysis: Counts digits, spaces, and punctuation

Case Transformations

Naming Convention Conversions:
  • camelCase: helloWorld (first word lowercase, rest capitalized)
  • PascalCase: HelloWorld (all words capitalized)
  • snake_case: hello_world (words separated by underscores)
  • kebab-case: hello-world (words separated by hyphens)

Encoding Operations

Base64:
  • Encodes binary data as ASCII text
  • Useful for embedding binary data in JSON
  • Decoding requires valid Base64 input
URL Encoding:
  • Encodes special characters for URLs
  • Spaces become %20, special chars become %XX
  • Safe for use in query parameters
HTML Encoding:
  • Converts special characters to HTML entities
  • < becomes &lt;, > becomes &gt;
  • Safe for embedding in HTML

Cipher Operations

ROT13:
  • Simple substitution cipher
  • Rotates each letter by 13 positions
  • Reversible (apply twice to get original)
Caesar Cipher:
  • Shifts each letter by a specified amount
  • Default shift is 3 positions
  • Can be customized with additional parameters

Best Practices

Text Processing

# Good - Analyze text for insights
curl "https://api.sinaty.business/text/?text=Hello World&operation=analyze"

# Good - Clean user input
curl "https://api.sinaty.business/text/?text=user input&operation=remove_duplicates"

Format Conversion

# Good - Convert naming conventions
curl "https://api.sinaty.business/text/?text=hello world&operation=camelcase"

# Good - Normalize case
curl "https://api.sinaty.business/text/?text=MiXeD cAsE&operation=lowercase"

Encoding

# Good - Encode for URLs
curl "https://api.sinaty.business/text/?text=hello world&operation=url_encode"

# Good - Encode for HTML
curl "https://api.sinaty.business/text/?text=<script>&operation=html_encode"

Performance Considerations

Large Text Handling

For large text inputs:
  • Use POST requests instead of GET
  • Consider breaking large text into chunks
  • Use simpler operations for better performance

Caching

Consider caching results for frequently processed text:
const cache = new Map();

async function processText(text, operation) {
    const key = `${text}-${operation}`;
    
    if (cache.has(key)) {
        return cache.get(key);
    }
    
    const result = await callTextAPI(text, operation);
    cache.set(key, result);
    return result;
}

Error Handling

Always implement proper error handling:
async function processText(text, operation = 'analyze') {
    try {
        const response = await fetch(
            `https://api.sinaty.business/text/?text=${encodeURIComponent(text)}&operation=${operation}`
        );
        
        if (!response.ok) {
            const error = await response.json();
            console.error('API Error:', error.error);
            console.error('Details:', error.details);
            return null;
        }
        
        const data = await response.json();
        return data;
    } catch (error) {
        console.error('Request failed:', error);
        return null;
    }
}

Common Use Cases

Data Cleaning

async function cleanUserInput(input) {
    // Remove duplicates and normalize case
    const cleaned = await processText(input, 'remove_duplicates');
    const normalized = await processText(cleaned.result, 'lowercase');
    return normalized.result;
}

Content Analysis

async function analyzeContent(content) {
    const analysis = await processText(content, 'analyze');
    return {
        wordCount: analysis.analysis.word_count,
        characterCount: analysis.analysis.length,
        readingTime: Math.ceil(analysis.analysis.word_count / 200) // 200 wpm
    };
}

Format Conversion

async function convertToCamelCase(text) {
    const result = await processText(text, 'camelcase');
    return result.result;
}
I