You're offline — check your connection

    Developer API · v1

    TINS HUB API

    Generate trend ideas, poll job status, and adapt briefs for additional platforms — all with a singletp_ API key.

    Authentication

    All requests require an API key in the Authorization header. Keys are Power tier only and can be created from Settings → API Access. You can have up to 5 active keys at a time.

    Authorization: Bearer tp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Base URL

    https://api.tinshub.com/api/v1

    /api/v1 is stable. Breaking changes will ship under/api/v2 with at least 90 days notice.

    API status

    Operational
    v1
    Deployed
    just now71978c6
    Rate limits
    100/min per IP · 30/min per user

    Live values from GET /api/v1/status. Cached 60s.

    Endpoints

    GET
    /api/v1/status

    Public health check. Returns current rate limits, the latest deploy timestamp, and a short commit SHA. No auth required, cached 60s.

    curl https://api.tinshub.com/api/v1/status

    Response (200)

    {
      "status": "ok",
      "version": "v1",
      "deployedAt": "2026-04-27T15:42:11.000Z",
      "commitSha": "abc1234",
      "rateLimits": {
        "perIpPerMinute": 100,
        "perUserPerMinute": 30
      }
    }
    POST
    /api/v1/trends

    Kick off a trend-brief generation job. Costs 1 credit (refunded if the pipeline returns no usable trends). Returns immediately with a jobId you can poll.

    curl -X POST https://api.tinshub.com/api/v1/trends \
      -H "Authorization: Bearer tp_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "niche": "indie game dev",
      "platform": "TikTok",
      "audience": "solo developers",
      "style": "educational",
      "geography": "global",
      "format": "Short video"
    }'

    Response (202)

    // 202 Accepted — generation started
    {
      "jobId": "8f3a2c0e-9b1d-4e7a-9f31-1c2d4e5f6a7b",
      "statusUrl": "/api/v1/trends/status?jobId=8f3a2c0e-..."
    }
    GET
    /api/v1/trends/status?jobId=...

    Poll a job. Returns partial briefs as they stream in, plus the final result once status is `completed`. Does not spend credits.

    curl https://api.tinshub.com/api/v1/trends/status?jobId=JOB_ID \
      -H "Authorization: Bearer tp_YOUR_KEY"

    Response (200, completed)

    // 200 OK — poll until status === "completed"
    {
      "jobId": "8f3a2c0e-...",
      "status": "completed",
      "step": "done",
      "stepMessage": "Complete",
      "partialBriefs": [/* same shape as result.trends, streamed */],
      "result": {
        "trends": [
          {
            "id": "trend-abc123",
            "name": "Solo dev devlogs",
            "momentum": 72,
            "region": "global",
            "whyRising": "Indie launches surging on TikTok",
            "fitScore": 85,
            "decision": "post_now",
            "angle": "Why your devlog needs a 'mistake of the week'",
            "hooks": [
              "I almost shipped a game-breaking bug. Here's how I caught it.",
              "Your devlog is boring. Here's the fix.",
              "3 mistakes every solo dev makes in their first devlog"
            ],
            "outline": {
              "talkingPoints": ["Hook with a specific mistake", "Show the bug visually", "Explain the root cause", "Lesson learned"],
              "cta": "Drop your worst dev mistake below.",
              "caption": "Devlogs hit different when you're honest. #indiedev #gamedev"
            },
            "format": "Short video",
            "confidence": "high"
          }
        ]
      }
    }
    GET
    /api/v1/trends/history

    List your recent generation jobs (up to 50). Useful for resuming flows or building dashboards.

    curl "https://api.tinshub.com/api/v1/trends/history?limit=10" \
      -H "Authorization: Bearer tp_YOUR_KEY"
    POST
    /api/v1/adapt

    Re-generate a previously-returned trend for additional platforms. Pass the source jobId + the trend's id (from result.trends[].id). Costs 0.5 credits per target platform (rounded up).

    curl -X POST https://api.tinshub.com/api/v1/adapt \
      -H "Authorization: Bearer tp_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "jobId": "8f3a2c0e-...",
        "trendId": "trend-abc123",
        "targetPlatforms": ["X", "Reddit", "YouTube"]
      }'

    Response (200)

    // 200 OK
    {
      "sourceJobId": "8f3a2c0e-...",
      "sourceTrendId": "trend-abc123",
      "creditsSpent": 2,
      "adaptations": [
        { "platform": "X", "trend": { "id": "adapt-x-...", "angle": "...", "hooks": [...], "outline": {...}, "format": "Thread" } },
        { "platform": "Reddit", "trend": { "id": "adapt-reddit-...", "angle": "...", "hooks": [...], "outline": {...}, "format": "Text post" } }
      ]
    }

    Rate limits

    • · 100 requests / minute per IP
    • · 30 requests / minute per user
    • · Exceeded limits return 429 Too Many Requests

    CORS & browser usage

    All /api/v1/* endpoints accept browser requests from any origin by default (Access-Control-Allow-Origin: *). Auth is bearer-token only, so we never set Allow-Credentials.

    For tighter security, restrict each key to specific origins from Settings → API Access. When an allow-list is set, the API only returns CORS headers for matching origins — browsers will block unauthorized sites. Note: origin restrictions are advisory; they don't prevent server-side reuse of a leaked key. Treat keys like passwords.

    Error format

    {
      "error": {
        "code": "INSUFFICIENT_CREDITS",
        "message": "Not enough credits."
      }
    }
    StatusCodeMeaning
    401AUTH_ERRORMissing or invalid API key
    402INSUFFICIENT_CREDITSBuy more credits or upgrade your plan
    403FORBIDDENYour tier does not have access to this endpoint
    404NOT_FOUNDJob or trend not found
    409VALIDATION_ERRORJob not yet completed (for adapt)
    400VALIDATION_ERRORRequest body is malformed
    429RATE_LIMITEDSlow down — see retry-after header
    5xxINTERNAL_ERRORTry again with exponential backoff

    Versioning

    /api/v1 is the stable contract. Additive changes (new optional fields, new endpoints) ship under v1 without notice. Breaking changes will ship under/api/v2 with at least 90 days of overlap and a deprecation header on v1 responses. Check GET /api/v1/status for the current deploy.