Developer Docs

SWOTPal Public API

Integrate AI-powered SWOT analysis into your applications with a simple REST API. Generate strategic analyses, run competitive comparisons, and retrieve results programmatically.

Base URL

All API requests should be made to the following base URL:

https://swotpal.com/api/public/v1

Authentication

Authenticate every request by including your API key in the Authorization header as a Bearer token.

Authorization: Bearer YOUR_API_KEY

Don't have a key yet? Get your free API key from the OpenClaw integration page.

Endpoints

POST/api/public/v1/swot

Generate a full AI-powered SWOT analysis for any company, product, or strategic topic.

Request Body

ParameterTypeRequiredDescription
topicstringYesSubject of the analysis, e.g. "Tesla" or "Remote Work Strategy"
languagestringNoISO 639-1 code. Defaults to "en". Supported: en, ja, zh_TW, ko, de, fr, es, pt, it, ru, ar, hi

Example Request

curl -X POST https://swotpal.com/api/public/v1/swot \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "Tesla",
    "language": "en"
  }'

Example Response

{
  "id": "swot_abc123",
  "topic": "Tesla",
  "language": "en",
  "created_at": "2026-03-09T12:00:00Z",
  "strengths": [
    "Market leader in electric vehicles",
    "Strong brand and loyal customer base",
    "Vertically integrated supply chain"
  ],
  "weaknesses": [
    "Production bottlenecks at scale",
    "Quality control inconsistencies",
    "High dependency on CEO public image"
  ],
  "opportunities": [
    "Expanding into emerging EV markets",
    "Energy storage and solar growth",
    "Autonomous driving technology"
  ],
  "threats": [
    "Increasing competition from legacy automakers",
    "Regulatory changes in key markets",
    "Raw material supply constraints"
  ]
}
POST/api/public/v1/versus

Run an AI-powered competitive comparison between two companies, products, or strategies.

Request Body

ParameterTypeRequiredDescription
leftstringYesFirst subject for comparison, e.g. "Nike"
rightstringYesSecond subject for comparison, e.g. "Adidas"
languagestringNoISO 639-1 code. Defaults to "en"

Example Request

curl -X POST https://swotpal.com/api/public/v1/versus \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "left": "Nike",
    "right": "Adidas",
    "language": "en"
  }'

Example Response

{
  "id": "vs_def456",
  "left": "Nike",
  "right": "Adidas",
  "language": "en",
  "created_at": "2026-03-09T12:00:00Z",
  "comparison": {
    "left_strengths": ["Stronger brand recognition globally", "..."],
    "right_strengths": ["Stronger presence in European football", "..."],
    "key_differences": ["Marketing strategy approach", "..."],
    "verdict": "Nike leads in global brand power while Adidas excels in ..."
  }
}
GET/api/public/v1/analyses

Retrieve a paginated list of all analyses created with your API key.

Query Parameters

ParameterTypeRequiredDescription
pagenumberNoPage number. Defaults to 1
limitnumberNoResults per page (1-100). Defaults to 20

Example Request

curl https://swotpal.com/api/public/v1/analyses?page=1&limit=10 \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "data": [
    {
      "id": "swot_abc123",
      "type": "swot",
      "topic": "Tesla",
      "language": "en",
      "created_at": "2026-03-09T12:00:00Z"
    },
    {
      "id": "vs_def456",
      "type": "versus",
      "topic": "Nike vs Adidas",
      "language": "en",
      "created_at": "2026-03-09T11:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 42,
    "total_pages": 5
  }
}
GET/api/public/v1/analyses/:id

Retrieve the full details of a specific analysis by its ID.

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe analysis ID, e.g. "swot_abc123"

Example Request

curl https://swotpal.com/api/public/v1/analyses/swot_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "id": "swot_abc123",
  "type": "swot",
  "topic": "Tesla",
  "language": "en",
  "created_at": "2026-03-09T12:00:00Z",
  "strengths": ["Market leader in electric vehicles", "..."],
  "weaknesses": ["Production bottlenecks at scale", "..."],
  "opportunities": ["Expanding into emerging EV markets", "..."],
  "threats": ["Increasing competition from legacy automakers", "..."]
}

Error Codes

The API uses standard HTTP status codes. Error responses include a JSON body with error and message fields.

CodeStatusDescription
400Bad RequestMissing or invalid parameters. Check the "message" field for details.
401UnauthorizedInvalid or missing API key. Make sure you include a valid Bearer token.
403ForbiddenYour API key does not have access to this resource.
404Not FoundThe requested analysis ID does not exist.
429Too Many RequestsRate limit exceeded. Wait and retry with exponential backoff.
500Internal Server ErrorSomething went wrong on our end. Try again or contact support.

Error Response Example

{
  "error": "INVALID_PARAMETER",
  "message": "The 'topic' field is required and must be a non-empty string."
}

Rate Limits

API requests are rate-limited to ensure fair usage. Current limits are returned in every response via headers:

PlanRequests / minuteRequests / day
Free10100
Pro605,000
Enterprise300Unlimited

Rate limit headers included with each response:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1741521660

When you receive a 429 response, use the X-RateLimit-Reset header (Unix timestamp) to determine when you can retry. Implementing exponential backoff is recommended.

Ready to integrate?

Get your free API key in seconds and start generating AI-powered SWOT analyses from your own applications.

Get Your API Key