Endpoints

Complete API reference for the WhatPeoplePayFor Worker API. All endpoints are prefixed with /agent and require a Bearer token.

GET/agent/bootstrap

Discover available data months, category count, and all queryable endpoints. Call this first to understand what data is available.

Parameters

None

Example

curl -H "Authorization: Bearer wpp_live_..." \
  https://api.whatpeoplepayfor.com/agent/bootstrap

Response

{
  "data": {
    "months": ["2026-03"],
    "categories": 274,
    "endpoints": {
      "ask": "/agent/ask",
      "query": "/agent/query/*",
      "sse": "/agent/sse/*"
    }
  }
}

POST/agent/ask

Ask a natural-language market question. The API returns an answer with supporting evidence and suggested next actions.

Request body

FieldTypeDescription
questionstringThe market question to answer

Example

curl -X POST \
  -H "Authorization: Bearer wpp_live_..." \
  -H "Content-Type: application/json" \
  -d '{"question": "What are the top growth categories?"}' \
  https://api.whatpeoplepayfor.com/agent/ask

Response

{
  "data": {
    "answer": "AI-generated services show the highest growth...",
    "evidence": {
      "categories_analyzed": 274,
      "top_movers": [...]
    },
    "next_actions": [
      "Query snapshots for AI category",
      "Check pain points in top categories"
    ]
  }
}

GET/agent/query/snapshots

Query individual gig snapshots with filtering, sorting, and pagination.

Parameters

ParamTypeDescription
monthstringData month, e.g. "2026-03"
category_slugstringFilter by category slug
qstringFull-text search query
limitnumberMax results (default 20)
offsetnumberPagination offset
sortstringSort field (e.g. "price", "orders")

Example

curl -H "Authorization: Bearer wpp_live_..." \
  "https://api.whatpeoplepayfor.com/agent/query/snapshots?month=2026-03&category_slug=ai-services&limit=5"

Response

{
  "data": [
    {
      "title": "I will build a custom AI chatbot",
      "price": 150,
      "orders": 342,
      "seller": "ai_expert",
      "category_slug": "ai-services",
      "month": "2026-03"
    }
  ]
}

GET/agent/query/category-rollups

Get category-level aggregations including average revenue, order counts, and gig counts.

Parameters

ParamTypeDescription
monthstringData month
limitnumberMax results
offsetnumberPagination offset
sortstringSort field (e.g. "avg_revenue")

Example

curl -H "Authorization: Bearer wpp_live_..." \
  "https://api.whatpeoplepayfor.com/agent/query/category-rollups?month=2026-03&limit=5&sort=avg_revenue"

Response

{
  "data": [
    {
      "category": "AI Services",
      "category_slug": "ai-services",
      "avg_revenue": 12500,
      "avg_orders": 85,
      "gig_count": 1240,
      "month": "2026-03"
    }
  ]
}

GET/agent/query/pain-points

Get extracted buyer pain points — common concerns and frustrations that buyers express when purchasing services.

Parameters

ParamTypeDescription
monthstringData month
category_slugstringFilter by category slug
limitnumberMax results

Example

curl -H "Authorization: Bearer wpp_live_..." \
  "https://api.whatpeoplepayfor.com/agent/query/pain-points?month=2026-03&category_slug=ai-services&limit=5"

Response

{
  "data": [
    {
      "pain_point": "Inconsistent output quality",
      "frequency": 42,
      "category_slug": "ai-services",
      "month": "2026-03"
    }
  ]
}

GET/agent/query/stats

Get overall dataset statistics for a given month — total snapshots, categories, and data points.

Parameters

ParamTypeDescription
monthstringData month

Example

curl -H "Authorization: Bearer wpp_live_..." \
  "https://api.whatpeoplepayfor.com/agent/query/stats?month=2026-03"

Response

{
  "data": {
    "total_snapshots": 48200,
    "total_categories": 274,
    "total_pain_points": 3150,
    "month": "2026-03"
  }
}

GET/agent/query/months

List all available data months. Use this to discover which months have data before querying.

Parameters

None

Example

curl -H "Authorization: Bearer wpp_live_..." \
  https://api.whatpeoplepayfor.com/agent/query/months

Response

{
  "data": ["2026-01", "2026-02", "2026-03"]
}

GET/agent/sse/snapshots

Server-Sent Events stream of gig snapshots. Same parameters as query/snapshots. Results are streamed as individual SSE events for real-time consumption.

Parameters

Same as query/snapshots (month, category_slug, q, limit, offset, sort).

Example

curl -N -H "Authorization: Bearer wpp_live_..." \
  "https://api.whatpeoplepayfor.com/agent/sse/snapshots?month=2026-03&limit=5"

data: {"title":"I will build a custom AI chatbot","price":150,"orders":342}
data: {"title":"I will create an AI voice assistant","price":200,"orders":218}
data: [DONE]

GET/agent/sse/category-rollups

Server-Sent Events stream of category rollups. Same parameters as query/category-rollups. Results are streamed as individual SSE events.

Parameters

Same as query/category-rollups (month, limit, offset, sort).

Example

curl -N -H "Authorization: Bearer wpp_live_..." \
  "https://api.whatpeoplepayfor.com/agent/sse/category-rollups?month=2026-03&limit=5"

data: {"category":"AI Services","avg_revenue":12500,"avg_orders":85,"gig_count":1240}
data: {"category":"Web Development","avg_revenue":9800,"avg_orders":120,"gig_count":2100}
data: [DONE]