API Documentation

XTracker REST API Reference

Overview

The XTracker API provides access to post tracking data for X (Twitter) and Truth Social users.

Base URL: https://xtracker.polymarket.com/api

Platforms

XTracker supports multiple social media platforms. Use the platform query parameter to filter by platform.

PlatformValuePost Term
X (Twitter)Xtweets
Truth SocialTRUTH_SOCIALtruths

Public Endpoints

GET/users

Get all tracked users with their tracking periods.

Query Parameters:
  • platform (string) - Filter by platform: X or TRUTH_SOCIAL
  • stats (boolean) - Include detailed posting statistics (legacy format)
  • includeInactive (boolean) - Include users with no active trackings
// Example Response
{
  "success": true,
  "data": [
    {
      "id": "uuid",
      "handle": "realDonaldTrump",
      "name": "Donald J. Trump",
      "platform": "TRUTH_SOCIAL",
      "platformId": "1",
      "avatarUrl": "https://...",
      "verified": true,
      "trackings": [...],
      "_count": { "posts": 95 }
    }
  ]
}
GET/users?stats=true&platform=TRUTH_SOCIAL

Get users with full statistics (legacy format for backward compatibility).

// Legacy Response Format (array, not wrapped)
[
  {
    "id": "uuid",
    "handle": "realDonaldTrump",
    "name": "Donald J. Trump",
    "platform": "TRUTH_SOCIAL",
    "startDate": "2026-01-15T17:00:00.000Z",
    "endDate": "2026-01-22T16:59:59.000Z",
    "tweetData": {
      "daily": [{ "start": "1/15/2026", "tweet_count": 12 }],
      "dailyTotal": [{ "start": "1/15/2026", "tweet_count": 12 }],
      "totalBetweenStartAndEnd": 95,
      "dailyAverage": 13.57,
      "pace": 95
    }
  }
]
GET/users/[handle]

Get a specific user by their handle.

Query Parameters:
  • platform (string) - Specify platform if handle exists on multiple platforms
// Example: GET /users/realDonaldTrump?platform=TRUTH_SOCIAL
GET/users/[handle]/posts

Get all posts for a user within a date range.

Query Parameters:
  • platform (string) - Specify platform
  • startDate (ISO date) - Filter posts after this date
  • endDate (ISO date) - Filter posts before this date
  • timezone (string) - Set to EST to interpret dates as Eastern time
GET/users/[handle]/trackings

Get all tracking periods for a specific user.

Query Parameters:
  • platform (string) - Specify platform
  • activeOnly (boolean) - Only return active trackings
GET/trackings

Get all tracking periods across all users.

Query Parameters:
  • activeOnly (boolean, default: true) - Filter to active trackings only
GET/trackings/[id]

Get a specific tracking period with optional statistics.

Query Parameters:
  • includeStats (boolean) - Include computed statistics
// Example: GET /trackings/uuid?includeStats=true
{
  "success": true,
  "data": {
    "id": "uuid",
    "title": "Week of Jan 15",
    "startDate": "2026-01-15T17:00:00.000Z",
    "endDate": "2026-01-22T16:59:59.000Z",
    "target": 100,
    "isActive": true,
    "user": {
      "handle": "realDonaldTrump",
      "platform": "TRUTH_SOCIAL"
    },
    "stats": {
      "total": 95,
      "percentComplete": 95,
      "daysElapsed": 1,
      "daysRemaining": 6,
      "daily": [...]
    }
  }
}
GET/metrics/[userId]

Get metrics for a specific user.

Query Parameters:
  • type (string, default: "daily") - Metric type
  • startDate (ISO date) - Start date filter
  • endDate (ISO date) - End date filter

Admin Endpoints

Admin endpoints are only visible to authenticated administrators.Login to view admin endpoints →

Response Format

All endpoints return JSON in this format:

// Success Response
{
  "success": true,
  "data": { ... },
  "message": "Optional success message"
}

// Error Response
{
  "success": false,
  "error": "Error message description"
}

Note: The /users?stats=true endpoint returns an array directly (legacy format) for backward compatibility.

Timezone Notes

All dates in the database are stored in UTC. Tracking periods are defined in EST (America/New_York). The daily arrays in stats use M/D/YYYY format in EST.