API Reference

Complete reference for the GuardCrow REST API.

Base URL

https://api.guardcrow.com/v1

Endpoints

MethodEndpointDescription
POST/v1/analyzeAnalyze text content
GET/v1/healthCheck API health status
POST

/v1/analyze

Analyze text content for toxicity, sentiment, and safety. This is the main endpoint for content moderation.

Request Headers

HeaderRequiredDescription
X-API-KeyYour API key
Content-TypeMust be application/json

Request Body

ParameterTypeRequiredDescription
contentstringText to analyze (max 10,000 chars)
metadataobjectOptional metadata (source, user_id, etc.)

Example Request

request.jsonjson
{
"content": "This product is amazing! Best purchase ever.",
"metadata": {
"source": "product-reviews",
"user_id": "user_123"
}
}

Response

FieldTypeDescription
passedbooleanWhether content passed moderation
scoreintegerToxicity score (0-10)
sentimentstringpositive, negative, neutral, or toxic
descriptionstringHuman-readable explanation
categoriesstring[]Detected categories (insult, threat, spam)
processingTimeMsintegerProcessing time in milliseconds

Example Response

response.jsonjson
{
"passed": true,
"score": 1,
"sentiment": "positive",
"description": "Content is safe. Positive product review with no harmful elements.",
"categories": [],
"processingTimeMs": 127
}

Score Interpretation

0-3
Safe
4-6
Moderate
7-10
Toxic
GET

/v1/health

Check the health status of the API. This endpoint does not require authentication.

Example Response

response.jsonjson
{
"status": "healthy",
"timestamp": "2025-01-18T15:30:00.000Z"
}