API Documentation

Everything you need to integrate TextMatch API into your application

Quick Start Guide

Get up and running with TextMatch API in less than 5 minutes. Follow these simple steps to make your first text comparison.

Step 1: Get Your API Key

Sign up for a free account and get your API key from the dashboard:

curl -X POST https://api.textmatch.com/v1/auth/signup

Step 2: Make Your First Request

const response = await fetch('https://api.textmatch.com/v1/compare', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    text1: "Premium wireless headphones with noise cancellation",
    text2: "High-end wireless earbuds featuring active noise reduction"
  })
});

const data = await response.json();
console.log(data);
// Output: { similarity_score: 89, confidence: "high", processing_time_ms: 45 }

Authentication

TextMatch API uses API keys for authentication. Include your API key in the Authorization header of every request.

curl -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     https://api.textmatch.com/v1/compare

Security Note

Never expose your API key in client-side code. Always make API calls from your backend server.

API Endpoints

POST /v1/compare

Compare two text snippets and get a similarity score.

Parameters:

  • text1 (string, required) - First text snippet
  • text2 (string, required) - Second text snippet
GET /v1/usage

Get your current API usage statistics.

GET /v1/status

Check API service status and response times.

Request Format

All API requests should be made to https://api.textmatch.com with JSON payloads.

{
  "text1": "Advanced smartphone with dual camera and fast processor",
  "text2": "Modern mobile phone featuring dual lens camera and high-speed CPU"
}

Tips for Better Results

  • • Include specific details and descriptive language
  • • Use natural language rather than just keywords
  • • Text content can be 10-500 words long
  • • Multiple languages are supported

Response Format

All successful API responses return JSON with a consistent structure:

{
  "similarity_score": 87,
  "confidence": "high",
  "processing_time_ms": 45,
  "details": {
    "semantic_similarity": 0.89,
    "feature_overlap": 0.85,
    "style_match": 0.91
  },
  "request_id": "req_1234567890"
}

Response Fields

Field Type Description
similarity_score integer Overall similarity score (0-100)
confidence string Confidence level: low, medium, high
processing_time_ms integer Processing time in milliseconds

Error Codes

TextMatch API uses conventional HTTP response codes to indicate success or failure:

400 Bad Request

Invalid request format or missing required parameters

401 Unauthorized

Invalid or missing API key

429 Rate Limited

Too many requests - rate limit exceeded

500 Server Error

Internal server error - please try again later

Rate Limits

Rate limits vary by subscription plan and are designed to ensure fair usage:

Plan Requests/Minute Burst Limit
Developer (Free) 10 20
Startup 100 200
Business 1000 2000
Enterprise Custom Custom

Official SDKs

We provide official SDKs for popular programming languages to make integration easier:

JavaScript/Node.js

npm install textmatch-api
const TextMatch = require('textmatch-api');
const client = new TextMatch('your-api-key');

const result = await client.compare(
  'High-performance laptop computer',
  'Powerful notebook PC'
);

Python

pip install textmatch-api
from textmatch import TextMatchClient

client = TextMatchClient('your-api-key')
result = client.compare(
    'High-performance laptop computer',
    'Powerful notebook PC'
)

More SDKs coming soon:

PHP Ruby Go Java

Ready to Start Building?

Get your API key and make your first request in minutes

View Examples