Content Optimization API

A specialized API that solves the growing content evaluation bottleneck in the age of AI-generated content. Endata enables developers to programmatically rank and evaluate content variations against specific business goals before deployment, eliminating subjective decision-making and manual review processes.

This API accepts multiple content variations (text, images, etc.) and provides objective, data-driven rankings based on user-defined optimization goals like engagement, conversion, clarity, or SEO performance. Each analysis includes detailed scores, identified strengths, and specific improvement suggestions for each content variation.

Designed for seamless integration into automated workflows, Endata serves as the critical intelligence layer between content generation and deployment, helping MarTech platforms, enterprises, and agencies scale their content operations while maintaining quality and effectiveness. The API's unified endpoint structure, comprehensive documentation, and flexible authentication make implementation straightforward for development teams of all sizes.

Transform your content selection from subjective guesswork to data-driven decisions with Endata's Content Optimization API.

Base URLs

https://endata.com/api/v1
Production API

Authentication

All API requests require authentication using an API key passed via the Authorization header.

Format

Bearer YOUR_API_KEY

Creating API Keys

You can generate API keys from your account dashboard. Each key can be named for different purposes (development, testing, production) and have different expiration settings.

Best Practices:
  • Use different keys for development and production environments
  • Rotate keys periodically for enhanced security
  • Never expose API keys in client-side code
  • Set appropriate expiration dates for your keys

Example

curl -X POST \
  https://endata.com/api/v1/evaluate \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "content_type": "text",
  "content_variations": [
    {
      "id": "text_1",
      "content": "Revolutionize Your Marketing with AI-Powered Analytics"
    },
    {
      "id": "text_2",
      "content": "AI Analytics: The Secret to 10x Marketing ROI"
    }
  ],
  "optimization_goal": "engagement"
}'

File Upload Support

The /evaluate endpoint supports direct file uploads for media content (images, videos, and audio) using multipart form-data requests. This removes the need to first host your media files elsewhere.

How It Works

  1. Send a multipart/form-data request with:
    • A field named data containing your JSON parameters
    • File fields following the pattern file_{content_type}_{variation_id}
  2. The server processes the uploaded files and includes them in the evaluation
  3. Results are returned in exactly the same format as URL-based requests

File Naming Convention

File fields must be named according to the following pattern:

file_{content_type}_{variation_id}

Examples:

  • file_image_img1 - For an image with variation ID "img1"
  • file_video_vid_example - For a video with variation ID "vid_example"
  • file_audio_podcast_intro - For audio with variation ID "podcast_intro"

Supported Media Types

Content Type Supported Formats Max Size
image JPEG, PNG, GIF, WebP 10MB
video MP4, WebM, QuickTime 10MB
audio MP3, WAV, OGG, WebM 10MB

Example Requests

cURL Example
curl -X POST \
  https://endata.com/api/v1/evaluate \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'data={
    "content_type": "image",
    "content_variations": [
      { "id": "img_1" },
      { "id": "img_2" }
    ],
    "optimization_goal": "engagement",
    "audience": "millennials"
  }' \
  -F 'file_image_img_1=@/path/to/image1.jpg' \
  -F 'file_image_img_2=@/path/to/image2.jpg'
JavaScript Example
// Using FormData for file uploads
const formData = new FormData();

// Add JSON parameters
formData.append('data', JSON.stringify({
  content_type: "image",
  content_variations: [
    { id: "img_1" },
    { id: "img_2" }
  ],
  optimization_goal: "engagement",
  audience: "millennials"
}));

// Add image files
formData.append('file_image_img_1', document.getElementById('fileInput1').files[0]);
formData.append('file_image_img_2', document.getElementById('fileInput2').files[0]);

// Send the request
const response = await fetch('https://endata.com/api/v1/evaluate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
    // Note: Don't set Content-Type header, it will be set automatically with the correct boundary
  },
  body: formData
});

const data = await response.json();
console.log(data);
Python Example
import requests

url = "https://endata.com/api/v1/evaluate"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

# Parameters as JSON
data = {
    "content_type": "image",
    "content_variations": [
        {"id": "img_1"},
        {"id": "img_2"}
    ],
    "optimization_goal": "engagement",
    "audience": "millennials"
}

# Create the multipart request
files = {
    'data': (None, json.dumps(data), 'application/json'),
    'file_image_img_1': ('image1.jpg', open('/path/to/image1.jpg', 'rb'), 'image/jpeg'),
    'file_image_img_2': ('image2.jpg', open('/path/to/image2.jpg', 'rb'), 'image/jpeg')
}

response = requests.post(url, files=files, headers=headers)
result = response.json()
print(result)
Mixed Content Example (URLs + Uploads)
// Using FormData for mixed content (URLs and file uploads)
const formData = new FormData();

// JSON data with mixed content sources
formData.append('data', JSON.stringify({
  content_type: "image",
  content_variations: [
    { 
      id: "img_1",
      content: "https://example.com/hosted-image.jpg"  // Already hosted image URL
    },
    { 
      id: "img_2"  // Will be uploaded directly
    }
  ],
  optimization_goal: "conversion"
}));

// Add only the image that needs to be uploaded
formData.append('file_image_img_2', document.getElementById('fileInput').files[0]);

const response = await fetch('https://endata.com/api/v1/evaluate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: formData
});

const data = await response.json();
console.log(data);

Endpoints

GET
/content-types

Get all supported content types

Retrieve a list of all supported content types that can be used for content evaluation requests.

Request Example

curl -X GET \
  https://endata.com/api/v1/content-types \
  -H 'Authorization: Bearer YOUR_API_KEY'

Request Parameters

Responses

200A list of supported content types
Example Response:
{
  "content_types": [
    "text",
    "image",
    "audio",
    "video"
  ]
}
GET
/optimization-goals

Get all supported optimization goals

Retrieve a list of all supported optimization goals that can be used for content evaluation requests.

Request Example

curl -X GET \
  https://endata.com/api/v1/optimization-goals \
  -H 'Authorization: Bearer YOUR_API_KEY'

Request Parameters

Responses

200A list of supported optimization goals
Example Response:
{
  "optimization_goals": [
    "visibility",
    "engagement",
    "conversion",
    "retention",
    "monetization"
  ]
}
GET
/sentiments

Get all supported sentiments

Retrieve a list of all supported sentiment options that can be specified in content evaluation requests.

Request Example

curl -X GET \
  https://endata.com/api/v1/sentiments \
  -H 'Authorization: Bearer YOUR_API_KEY'

Request Parameters

Responses

200A list of supported sentiment options
Example Response:
{
  "sentiments": [
    "trustworthy",
    "authoritative",
    "urgent",
    "empathetic",
    "innovative",
    "positive",
    "curious",
    "transparent"
  ]
}
GET
/audiences

Get all supported audience options

Retrieve a list of all supported audience categories that can be specified in content evaluation requests.

Request Example

curl -X GET \
  https://endata.com/api/v1/audiences \
  -H 'Authorization: Bearer YOUR_API_KEY'

Request Parameters

Responses

200A list of supported audience categories
Example Response:
{
  "audiences": [
    "technical_decision_makers",
    "marketing_professionals",
    "gen_z",
    "millennials",
    "parents",
    "young_professionals",
    "enterprise_buyers",
    "creatives",
    "general_public",
    "... and many more"
  ]
}
GET
/funnel-stages

Get all supported funnel stages

Retrieve a list of all supported marketing funnel stages that can be specified in content evaluation requests.

Request Example

curl -X GET \
  https://endata.com/api/v1/funnel-stages \
  -H 'Authorization: Bearer YOUR_API_KEY'

Request Parameters

Responses

200A list of supported marketing funnel stages
Example Response:
{
  "funnel_stages": [
    "awareness",
    "consideration",
    "decision",
    "conversion",
    "implementation",
    "expansion",
    "retention",
    "advocacy"
  ]
}
GET
/brand-styles

Get all supported brand styles

Retrieve a list of all supported brand style options that can be specified in content evaluation requests.

Request Example

curl -X GET \
  https://endata.com/api/v1/brand-styles \
  -H 'Authorization: Bearer YOUR_API_KEY'

Request Parameters

Responses

200A list of supported brand style options
Example Response:
{
  "brand_styles": [
    "professional",
    "technical",
    "accessible",
    "innovative",
    "data_driven",
    "concise",
    "trustworthy",
    "conversational"
  ]
}
POST
/evaluate

Evaluate and rank content variations

Compare multiple content variations against a specific optimization goal. This endpoint accepts 1-10 content variations of the same type and returns a ranked list with detailed analysis of each variation's strengths and improvement areas. The response includes your remaining credit balance.

This endpoint supports both JSON requests and multipart form-data requests for direct file uploads of images, videos, and audio files.

Note: This endpoint supports direct file uploads via multipart form-data requests. See details

Request Example

curl -X POST \
  https://endata.com/api/v1/evaluate \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "content_type": "text",
  "content_variations": [
    {
      "id": "text_1",
      "content": "Revolutionize Your Marketing with AI-Powered Analytics"
    },
    {
      "id": "text_2",
      "content": "AI Analytics: The Secret to 10x Marketing ROI"
    }
  ],
  "optimization_goal": "engagement"
}'

Request Parameters

Parameter Type Required Description
content_typestring (enum) Yes Type of content being evaluated
Example:
text
content_variationsarray Yes Array of content variations to evaluate (1-10 items)
optimization_goalstring (enum) Yes The goal to optimize for
Example:
engagement
sentimentstring (enum) NoThe desired emotional tone for the content (optional)
Example:
innovative
audiencestring (enum) NoThe target audience for the content (optional)
Example:
marketing_professionals
funnel_stagestring (enum) NoThe marketing funnel stage where the content will be used (optional)
Example:
awareness
brand_stylestring (enum) NoThe brand style to align with (optional)
Example:
innovative
metadataobject NoAdditional metadata for tracking purposes
Example:
{
  "campaign_id": "summer_promo_2025",
  "source": "marketing_team"
}

Responses

200Successful evaluation
Example Response:
{
  "request_id": "req_1a2b3c4d5e6f",
  "rankings": [
    {
      "rank": 1,
      "content_id": "text_2",
      "score": 0.87,
      "goal_relevance": "High engagement potential with clear call-to-action",
      "strengths": [
        "Strong value proposition",
        "Includes specific benefit (10x ROI)",
        "Creates curiosity"
      ],
      "improvement_areas": [
        "Could be more specific to target audience"
      ],
      "issues": [
        "Benefit claim needs substantiation"
      ],
      "recommendations": [
        "Add social proof or case study reference",
        "Emphasize unique selling proposition"
      ],
      "tags": [
        "clear",
        "concise",
        "informative"
      ]
    },
    {
      "rank": 2,
      "content_id": "text_3",
      "score": 0.74,
      "goal_relevance": "Moderately engaging but lacks clear direction",
      "strengths": [
        "Evokes transformation",
        "Clear AI focus"
      ],
      "improvement_areas": [
        "Less specific about benefits",
        "Missing call-to-action element"
      ],
      "issues": [
        "Generic language",
        "No clear value proposition"
      ],
      "recommendations": [
        "Quantify benefits",
        "Add strong call-to-action"
      ],
      "tags": [
        "transformative",
        "technology-focused"
      ]
    },
    {
      "rank": 3,
      "content_id": "text_1",
      "score": 0.68,
      "goal_relevance": "Low engagement potential due to generic messaging",
      "strengths": [
        "Direct and clear",
        "Mentions both AI and analytics"
      ],
      "improvement_areas": [
        "Generic language ('revolutionize')",
        "Less emotionally compelling"
      ],
      "issues": [
        "Overused buzzwords",
        "No specific differentiation"
      ],
      "recommendations": [
        "Replace generic terms with specific benefits",
        "Include emotional trigger words"
      ],
      "tags": [
        "generic",
        "direct",
        "basic"
      ]
    }
  ],
  "confidence_score": 0.92,
  "optimization_goal": "engagement",
  "echo": {
    "content_type": "text",
    "optimization_goal": "engagement",
    "audience": "marketing_professionals"
  },
  "credits": {
    "used": 6,
    "remaining": 994
  }
}
400Invalid request
Example Response:
{
  "error": {
    "code": "invalid_request",
    "message": "Request validation failed. See details for more information.",
    "request_id": "req_1a2b3c4d5e6f",
    "details": {
      "content_variations": "Array must contain between 2 and 10 items"
    }
  }
}
401Authentication failed
Example Response:
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid API key or missing authentication",
    "request_id": "req_2b3c4d5e6f7"
  }
}
402Not enough credits
Example Response:
{
  "error": {
    "code": "payment_required",
    "message": "Insufficient credits. Required: 24, Available: 10",
    "request_id": "req_3c4d5e6f7g8"
  }
}
415Unsupported Media Type
Example Response:
{
  "error": {
    "code": "unsupported_media_type",
    "message": "File image1.xyz has unsupported type for image content",
    "request_id": "req_4d5e6f7g8h9"
  }
}
429Rate limit exceeded
Example Response:
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded. Try again in 35 seconds.",
    "request_id": "req_4d5e6f7g8h9"
  }
}
500Unexpected server error
Example Response:
{
  "error": {
    "code": "server_error",
    "message": "An unexpected error occurred. Please try again later.",
    "request_id": "req_6f7g8h9i0j1"
  }
}

Response Fields