Handles API

Side-by-side metrics for up to ten accounts

POSThttps://api.handlesapi.com/v1/insights/x/compare
1 creditinsights:read

The POST /v1/insights/x/compare endpoint of Handles API (Insights): Side-by-side metrics for up to ten accounts. One call costs 1 credit (a catalog read) and needs the insights:read scope. A success returns JSON as { data, meta }.

Competitive analysis in one call: the same engagement block and cohort placement for every handle in the body, plus a ranking by engagement rate so follower count does not decide the answer. Handles we have not measured come back with null metrics and their coverage marker rather than being dropped.

  • At most 10 handles per call.
  • Ranking excludes handles with no tweet coverage; they are still present in accounts with coverage.tweets=false.
  • Rates are only comparable between accounts of similar size. peer_percentile is the size-adjusted number and is the fairer column to sort a competitive set on.

Request

curl -X POST "https://api.handlesapi.com/v1/insights/x/compare" \
  -H "Authorization: Bearer $HANDLES_API_KEY"

Set HANDLES_API_KEY to a key from your dashboard. Keys start with hk_live_.

Request body

JSON, sent with Content-Type: application/json.

FieldTypeRequiredDescription
handlesarray of stringRequiredArray of X handles without the @, 1-10 of them, for example ["elonmusk","BillGates","NASA"]. Duplicates are collapsed case-insensitively before they take a slot.
metricenumOptionalEchoed onto the response for clients that batch several metrics.

Response

Success is always { data, meta }.

200 OK
{
  "data": {
    "requested": 3,
    "resolved": 3,
    "ranking": [
      {
        "handle": "elonmusk",
        "engagement_rate": 0.0471,
        "peer_percentile": 99.7,
        "followers": 241382119
      },
      {
        "handle": "BillGates",
        "engagement_rate": 0.0142,
        "peer_percentile": 71,
        "followers": 65130442
      },
      {
        "handle": "NASA",
        "engagement_rate": 0.0117,
        "peer_percentile": 62,
        "followers": 96204881
      }
    ],
    "accounts": [
      {
        "handle": "elonmusk",
        "found": true,
        "coverage": {
          "tweets": true,
          "reliable": true
        }
      }
    ]
  },
  "meta": {
    "request_id": "req_9f2c41a8b3d5",
    "generated_at": "2026-08-23T09:14:02.317Z",
    "took_ms": 42
  }
}

Response headers

Every successful response carries these headers.

HeaderTypeDescription
X-Request-IdstringQuote this to support.
X-RateLimit-LimitintegerRequests allowed in the current one-minute window.
X-RateLimit-RemainingintegerRequests left in the current one-minute window.
X-RateLimit-ResetintegerUnix seconds at which the current window resets.
X-Credits-CostintegerCredits this call used.
X-Credits-RemainingintegerPlan credits left in the current period.
X-Credits-Period-EndstringWhen the current period ends (ISO 8601).

Errors

StatusError codeWhen
401unauthorizedNo key was sent, or the key is unknown or revoked.
402quota_exceededYour plan's credits for this period are used up and overage is off (or its cap is reached). Waiting does not help: upgrade, or turn on overage in the dashboard.
422invalid_requestA parameter is malformed, out of range or mutually exclusive with another. details names the offending fields.
429rate_limitedlive_limit_reachedToo many requests. rate_limited clears when the minute window resets (see Retry-After); live_limit_reached (Free plan) clears at 00:00 UTC.Also sends Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
500internal_errorSomething failed on our side. The call was not charged; quote the request_id to support.
503upstream_timeoutupstream_errorplatform_unavailableservice_unavailableThe call could not be served right now and was not charged. upstream_timeout / upstream_error: a data source was slow or failed, retry with backoff. platform_unavailable: live reads for that platform are paused. service_unavailable: retry shortly.

Failures use the error envelope. Branch on error.code, never on the message.