API Reference

Complete reference for all Entity Detector API endpoints.

Base URL

https://api.entitydetector.com/v1

Authentication

All API requests require authentication using a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN

POST /v1/analyze

Analyze text to extract entities, relations, and sentiment.

Request Body

json
{
  "text": "Article text to analyze (200-30000 characters)",
  "options": {
    "languageHint": "en",
    "maxEntitiesPerType": 50,
    "includeEvidence": true
  }
}

Parameters

ParameterTypeRequiredDescription
textstringYesText to analyze (200-30,000 characters)
options.languageHintstringNoISO 639-1 language code (e.g., "en", "es", "de")
options.maxEntitiesPerTypenumberNoMaximum entities per type (default: 50, max: 100)
options.includeEvidencebooleanNoInclude text evidence for relations (default: true)

Response

json
{
  "entities": {
    "persons": ["John Smith", "Jane Doe"],
    "organizations": ["Acme Corp", "TechStartup Inc"],
    "locations": ["New York", "San Francisco"],
    "objects": ["laptop", "contract"]
  },
  "relations": [
    {
      "source": "John Smith",
      "target": "Acme Corp",
      "type": "works_for",
      "evidence": "John Smith, CEO of Acme Corp",
      "sentiment": "neutral",
      "confidence": 0.95
    }
  ],
  "meta": {
    "model": "qwen2.5:1.5b-instruct",
    "language": "en",
    "processingMs": 1523,
    "cached": false
  }
}

Response Fields

FieldTypeDescription
entities.personsstring[]People mentioned in the text
entities.organizationsstring[]Companies, institutions, groups
entities.locationsstring[]Places, cities, countries, addresses
entities.objectsstring[]Physical or conceptual objects
relations[].sourcestringSource entity in the relation
relations[].targetstringTarget entity in the relation
relations[].typestringRelation type (e.g., "works_for", "located_in")
relations[].evidencestringText excerpt supporting the relation
relations[].sentimentstring"positive", "negative", or "neutral"
relations[].confidencenumberConfidence score (0.0 - 1.0)
meta.modelstringAI model used for analysis
meta.languagestringDetected language code
meta.processingMsnumberProcessing time in milliseconds
meta.cachedbooleanWhether result was served from cache

GET /v1/quota

Check your current API usage quota.

Response

json
{
  "plan": "free",
  "daily": {
    "limit": 100,
    "used": 23,
    "remaining": 77
  },
  "resetAt": "2024-01-16T00:00:00Z"
}

Response Fields

FieldDescription
planYour current plan (free, starter, pro, business)
daily.limitMaximum daily requests allowed
daily.usedRequests used today
daily.remainingRequests remaining today
resetAtISO 8601 timestamp when quota resets

HTTP Status Codes

CodeDescription
200Success
400Bad Request - Invalid input
401Unauthorized - Invalid or missing token
429Rate Limited - Quota exceeded
500Server Error - Something went wrong