Text Analysis API

Overview

Comprehensive text analysis API for pattern detection and NLP analysis with support for raw text, file uploads, and URL content extraction.

The Text Analysis API provides powerful text analysis capabilities through a simple REST interface. It combines pattern detection (emails, phone numbers, credit cards, etc.) with advanced NLP analysis powered by OpenAI technology.

Key features:

  • Multi-pattern detection in a single request
  • Language detection and sentiment analysis
  • Named entity recognition (people, organizations, locations)
  • Topic and keyword extraction
  • Content moderation
  • Support for direct text input, file uploads (PDF, DOCX, TXT, HTML), and URL content analysis

Ideal for:

  • Extracting structured information from unstructured text
  • Content moderation for websites and applications
  • Enhancing search capabilities with NLP insights
  • Document analysis and classification
  • Automated content tagging and categorization

Pricing Plans

Choose the right plan for your text analysis needs with flexible pricing options

Basic

Free

Perfect for small projects and testing

  • 10 requests per month
Get Started
Recommended

Pro

$9.99 /mo

For professional developers

  • 100 requests per month
Get Started

Ultra

$79.99 /mo

For growing businesses

  • 1,000 requests per month
Get Started

Mega

$499.99 /mo

For enterprises

  • 10,000 requests per month
Get Started

API Documentation

Base URL

https://text-analysis-api2.p.rapidapi.com

Authentication

All API requests require authentication using RapidAPI headers:

{
  'x-rapidapi-host': 'text-analysis-api2.p.rapidapi.com',
  'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY'
}

Endpoints

1. Analyze Text

Endpoint: POST /v1/analyze/text

Description: Analyze raw text input for patterns and perform NLP analysis.

Request Example
curl --request POST \
  --url https://text-analysis-api2.p.rapidapi.com/v1/analyze/text \
  --header 'content-type: application/json' \
  --header 'x-rapidapi-host: text-analysis-api2.p.rapidapi.com' \
  --header 'x-rapidapi-key: RAPIDAPI_KEY' \
  --data '{
    "text": "Hello! Contact me at [email protected] or call +1 (555) 123-4567. My website is https://example.com and I work at Example Corp located in New York."
}'

2. Analyze File Upload

Endpoint: POST /v1/analyze/upload

Description: Upload and analyze a file (PDF, DOCX, TXT, HTML).

Request Example
curl --request POST \
  --url https://text-analysis-api2.p.rapidapi.com/v1/analyze/upload \
  --header 'content-type: multipart/form-data' \
  --header 'x-rapidapi-host: text-analysis-api2.p.rapidapi.com' \
  --header 'x-rapidapi-key: RAPIDAPI_KEY' \
  --form 'file=@/path/to/your/document.pdf'

Response Example

{
    "success": true,
    "analyzed_at": "2025-05-04T08:20:53.933Z",
    "detections": {
        "languages": [
            {
                "value": "English"
            }
        ],
        "entities": {
            "people": [
                {
                    "value": "John Smith"
                },
                {
                    "value": "Maria Garcia"
                }
            ],
            "organizations": [
                {
                    "value": "TechCorp"
                }
            ],
            "locations": [
                {
                    "value": "San Francisco"
                },
                {
                    "value": "New York"
                }
            ]
        },
        "topics": [
            {
                "value": "Contact Information"
            },
            {
                "value": "Technical Information"
            }
        ],
        "categories": [
            {
                "value": "business"
            },
            {
                "value": "technical"
            }
        ],
        "keywords": [
            {
                "value": "contact"
            },
            {
                "value": "location"
            }
        ],
        "patterns": {
            "email": [
                {
                    "value": "[email protected]",
                    "index": 20,
                    "length": 19
                }
            ],
            "phone": [
                {
                    "value": "+1 (555) 123-4567",
                    "index": 50,
                    "length": 17
                }
            ],
            "url": [
                {
                    "value": "https://example.com",
                    "index": 86,
                    "length": 19
                }
            ]
        }
    },
    "count": 12
}

Response Codes

Status Code Description
200 Success
400 Bad Request
401 Unauthorized
429 Too Many Requests
500 Internal Server Error

Frequently Asked Questions

What types of text patterns can the API detect?

The Text Analysis API can detect a wide range of patterns including email addresses, phone numbers, URLs, IP addresses, dates, credit card numbers, social security numbers, GPS coordinates, and more. The API combines pattern matching with NLP capabilities to provide comprehensive text analysis.

What file formats are supported for analysis?

The API supports multiple file formats for analysis, including PDF, DOCX, TXT, and HTML files. When you upload a file, the API will automatically extract the text content and perform the requested analysis. File size limitations may apply depending on your subscription plan.

How accurate is the entity recognition capability?

The entity recognition capabilities are powered by advanced NLP models including OpenAI technology. While accuracy varies depending on context, the API typically achieves over 90% accuracy for identifying people, organizations, and locations in clearly written text. Results may vary for ambiguous content, specialized technical terminology, or uncommon names.

Can the API analyze content in languages other than English?

Yes, the Text Analysis API supports multiple languages for basic pattern detection. However, the depth and accuracy of NLP analysis (entity recognition, sentiment analysis, etc.) is highest for English content. The API can detect the language of the provided text and will return this information in the response.

What are the usage limits for the Text Analysis API?

The API offers several pricing tiers with different usage limits. The Basic free plan includes 10 requests per month. The Pro plan ($9.99/month) provides 100 requests per month, the Ultra plan ($79.99/month) allows 1,000 requests per month, and the Mega plan ($499.99/month) supports up to 10,000 requests per month. Choose the plan that best fits your expected usage volume. If you need higher limits or custom pricing, contact the API provider for enterprise solutions.