API Reference

Complete documentation for the ProfessorX API. Build powerful applications with our AI-powered content generation endpoints.

Base URL
https://api.professorx.in/v1

Authentication

The ProfessorX API uses API key authentication. Include your API key in the Authorization header of every request.

Getting Your API Key
  1. Sign in to your ProfessorX dashboard
  2. Navigate to Settings > API Keys
  3. Click "Generate New Key"
  4. Copy and securely store your API key
Authentication Header
Authorization: Bearer YOUR_API_KEY
Security Note: Keep your API key secure and never expose it in client-side code.

API Endpoints

ProfessorX provides several endpoints for different content generation and management tasks.

POST
/content/generate

Generate AI-powered content

GET
/content/{id}

Retrieve generated content

POST
/seo/analyze

Analyze content for SEO

GET
/analytics/usage

Get usage statistics

Content Generation

Generate high-quality content using our AI models.

POST /content/generate
Request Body
{
  "prompt": "Write a blog post about artificial intelligence",
  "type": "blog_post",
  "tone": "professional",
  "length": "medium",
  "seo_keywords": ["AI", "artificial intelligence", "technology"],
  "target_audience": "business professionals",
  "language": "en"
}
Parameters
Parameter Type Required Description
prompt string Required The content topic or description
type string Required Content type: blog_post, article, social_media, etc.
tone string Optional Writing tone: professional, casual, friendly, etc.
length string Optional Content length: short, medium, long
seo_keywords array Optional Keywords for SEO optimization
Response
{
  "id": "content_123456789",
  "status": "completed",
  "content": "Artificial Intelligence (AI) has become...",
  "word_count": 1250,
  "seo_score": 95,
  "keywords_used": ["AI", "artificial intelligence", "technology"],
  "generated_at": "2024-01-15T10:30:00Z",
  "processing_time": 2.3
}

SEO Analysis

Analyze and optimize your content for search engines.

POST /seo/analyze
Request Body
{
  "content": "Your content to analyze...",
  "target_keywords": ["SEO", "optimization"],
  "url": "https://example.com/article"
}
Response
{
  "seo_score": 85,
  "readability_score": 92,
  "keyword_density": {
    "SEO": 2.1,
    "optimization": 1.8
  },
  "suggestions": [
    "Add more internal links",
    "Optimize meta description"
  ],
  "meta_tags": {
    "title": "Suggested title",
    "description": "Suggested meta description"
  }
}

Rate Limits

API rate limits help ensure fair usage and optimal performance for all users.

Basic Plan
100
requests/hour
Pro Plan
1,000
requests/hour
Enterprise
Custom
unlimited
Rate Limit Headers
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1642262400

Error Handling

The ProfessorX API uses conventional HTTP response codes to indicate success or failure.

Code Status Description
200 OK Request successful
400 Bad Request Invalid request parameters
401 Unauthorized Invalid or missing API key
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error occurred
Error Response Format
{
  "error": {
    "code": "invalid_parameter",
    "message": "The 'prompt' parameter is required",
    "details": {
      "parameter": "prompt",
      "expected": "string"
    }
  }
}

Official SDKs

Get started quickly with our official SDKs for popular programming languages

JavaScript/Node.js

Official JavaScript SDK for browser and Node.js applications.

npm install @professorx/api
View on GitHub
Python

Python SDK with full API coverage and async support.

pip install professorx-api
View on GitHub
PHP

PHP SDK with Laravel integration and modern PHP features.

composer require professorx/api
View on GitHub

Code Examples

See the ProfessorX API in action with these practical examples

const ProfessorX = require('@professorx/api');

const client = new ProfessorX({
  apiKey: 'your_api_key_here'
});

async function generateContent() {
  try {
    const response = await client.content.generate({
      prompt: 'Write a blog post about AI trends in 2024',
      type: 'blog_post',
      tone: 'professional',
      length: 'medium'
    });
    
    console.log('Content generated:', response.content);
    console.log('SEO Score:', response.seo_score);
  } catch (error) {
    console.error('Error:', error.message);
  }
}

generateContent();
import professorx

client = professorx.Client(api_key='your_api_key_here')

def generate_content():
    try:
        response = client.content.generate(
            prompt='Write a blog post about AI trends in 2024',
            type='blog_post',
            tone='professional',
            length='medium'
        )
        
        print(f'Content generated: {response.content}')
        print(f'SEO Score: {response.seo_score}')
    except professorx.APIError as e:
        print(f'Error: {e.message}')

generate_content()
<?php
require_once 'vendor/autoload.php';

use ProfessorX\Client;

$client = new Client([
    'api_key' => 'your_api_key_here'
]);

try {
    $response = $client->content->generate([
        'prompt' => 'Write a blog post about AI trends in 2024',
        'type' => 'blog_post',
        'tone' => 'professional',
        'length' => 'medium'
    ]);
    
    echo "Content generated: " . $response['content'] . "\n";
    echo "SEO Score: " . $response['seo_score'] . "\n";
} catch (ProfessorX\Exception\APIException $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>
curl -X POST "https://api.professorx.in/v1/content/generate" \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Write a blog post about AI trends in 2024",
    "type": "blog_post",
    "tone": "professional",
    "length": "medium"
  }'

Ready to Build with ProfessorX?

Start integrating our powerful AI content generation API into your applications today.

Free tier available • No credit card required