twittrapi-com Trends API

Trends endpoints (read-only GET).

Operations 2

GET /trends/{locationId} Trends by location #
GET /misc/locations Trend locations #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/twittrapi-com:twittrapi-com-trends-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

twittrapi-com-trends-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: TwittrAPI Trends API
  version: 1.0.0
  summary: Public Twitter/X data over REST, priced per API call.
  description: 'TwittrAPI is a REST API for public Twitter/X data: users, tweets, search, followers, lists, communities, jobs and trends. Pay per call from a prepaid balance; no X developer account needed.


    Authentication: send your key in the X-API-KEY header. Get a key at https://www.twittrapi.com/start (a human signs up; the key can then be given to an agent).


    Responses: X''s raw JSON by default (passthrough), or add format=simple for compact, flat JSON with a fixed schema (same price).


    Account actions (tag "Account actions", /client/* and /premium/*): POST endpoints that act on your own X account with its session cookie and your proxy in the JSON body (https://www.twittrapi.com/docs/x-session). Same price per call as reads; trial keys cannot call them.


    Pricing (machine-readable): https://www.twittrapi.com/pricing.json. All docs in one file: https://www.twittrapi.com/llms-full.txt.


    RapidAPI: the same paths on https://twitter-aio.p.rapidapi.com with the x-rapidapi-key and x-rapidapi-host headers.


    Not affiliated with X Corp. Twitter and X are trademarks of X Corp. Only publicly available data is accessible.'
  contact:
    name: TwittrAPI support
    email: support@twittrapi.com
    url: https://www.twittrapi.com/docs
  termsOfService: https://www.twittrapi.com/terms
  license:
    name: 'Proprietary: use under the terms of service'
    url: https://www.twittrapi.com/terms
servers:
- url: https://api.twittrapi.com
  description: Direct API
- url: https://twitter-aio.p.rapidapi.com
  description: RapidAPI (x-rapidapi-key and x-rapidapi-host headers instead of X-API-KEY)
security:
- ApiKeyAuth: []
tags:
- name: Trends
  description: Trends endpoints (read-only GET).
paths:
  /trends/{locationId}:
    get:
      operationId: trendsLocationid
      summary: Trends by location
      description: 'Current trending topics for a place, by WOEID.


        Reference: https://www.twittrapi.com/docs/reference/trends-locationid'
      tags:
      - Trends
      externalDocs:
        url: https://www.twittrapi.com/docs/reference/trends-locationid
      parameters:
      - name: locationId
        in: path
        required: true
        description: Yahoo WOEID, digits only (1 to 12). 1 is worldwide, 23424977 the United States. /misc/locations lists them all.
        schema:
          type: string
      - name: format
        in: query
        required: false
        description: 'raw (default): X''s JSON passed through. simple: flat camelCase JSON with a fixed schema and a {data, nextCursor, previousCursor, hasNextPage} envelope. Same price. The header X-Response-Format: simple does the same.'
        schema:
          type: string
          enum:
          - raw
          - simple
          default: raw
      responses:
        '200':
          description: 'Raw JSON of X''s v1.1 trends/place endpoint: an array with one object holding trends (name, url, query, tweet_volume), as_of and locations.


            With format=simple: Collection of Trend objects {name, query, url, tweetVolume} (no cursor). query is URL-decoded.'
          headers:
            X-Price-Per-Call:
              description: What this call cost, in USD
              schema:
                type: string
            X-Remaining-Balance:
              description: Balance after this call (and after a refund, if any)
              schema:
                type: string
            X-Refunded:
              description: true when the call was refunded
              schema:
                type: string
            X-Retried:
              description: true when the gateway needed more than one attempt
              schema:
                type: string
            X-Response-Format:
              description: simple when the simple format was returned
              schema:
                type: string
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/TrendPage'
                - $ref: '#/components/schemas/RawPassthrough'
                description: 'format=simple: the simple-format schema. Default (raw): X''s JSON, passthrough.'
        '400':
          description: locationId is missing or not a numeric WOEID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
  /misc/locations:
    get:
      operationId: miscLocations
      summary: Trend locations
      description: 'All places X has trends for, with their WOEIDs.


        Reference: https://www.twittrapi.com/docs/reference/misc-locations'
      tags:
      - Trends
      externalDocs:
        url: https://www.twittrapi.com/docs/reference/misc-locations
      parameters:
      - name: format
        in: query
        required: false
        description: 'raw (default): X''s JSON passed through. simple: flat camelCase JSON with a fixed schema and a {data, nextCursor, previousCursor, hasNextPage} envelope. Same price. The header X-Response-Format: simple does the same.'
        schema:
          type: string
          enum:
          - raw
          - simple
          default: raw
      responses:
        '200':
          description: 'Raw JSON of X''s v1.1 trends/available endpoint: an array of places with name, woeid, country and placeType.


            With format=simple: Collection of TrendLocation objects {woeid, name, country, countryCode, placeType, parentId} (no cursor).'
          headers:
            X-Price-Per-Call:
              description: What this call cost, in USD
              schema:
                type: string
            X-Remaining-Balance:
              description: Balance after this call (and after a refund, if any)
              schema:
                type: string
            X-Refunded:
              description: true when the call was refunded
              schema:
                type: string
            X-Retried:
              description: true when the gateway needed more than one attempt
              schema:
                type: string
            X-Response-Format:
              description: simple when the simple format was returned
              schema:
                type: string
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/TrendLocationPage'
                - $ref: '#/components/schemas/RawPassthrough'
                description: 'format=simple: the simple-format schema. Default (raw): X''s JSON, passthrough.'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  responses:
    PaymentRequired:
      description: No balance left, or the trial expired. Not charged. Top up in the dashboard.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or unknown API key. Not charged.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: 'Rate limit for your key exceeded. Not charged. No Retry-After header: back off exponentially.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Key deactivated, or the endpoint is not in your plan (trial keys and account actions). Not charged.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Something failed on our side or between us and X. Refunded (400, 407, 408, 409 or a 5xx error are refunded). Retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    RawPassthrough:
      type: object
      additionalProperties: true
      description: X's own JSON (raw format, the default), passed through unchanged. The shape is X's and can change; see https://www.twittrapi.com/docs/response-format.
    Error:
      type: object
      properties:
        error:
          type: string
          description: Message. Do not parse it; use the status code.
        errorInfo:
          description: X's raw reply, on some endpoints
        attempts:
          type: integer
          description: Search retries
        errorCode:
          type: string
      required:
      - error
    TrendLocation:
      type: object
      properties:
        woeid:
          type: integer
        name:
          type: string
        country:
          type: string
        countryCode:
          type:
          - string
          - 'null'
        placeType:
          type: string
        parentId:
          type:
          - integer
          - 'null'
      required:
      - woeid
      - name
      - country
      - countryCode
      - placeType
      - parentId
    TrendLocationPage:
      type: object
      description: 'Simple format: trend locations (no cursor)'
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TrendLocation'
        nextCursor:
          type:
          - string
          - 'null'
          description: Pass as cursor for the next page; null on the last page
        previousCursor:
          type:
          - string
          - 'null'
          description: X's top cursor, for polling newer items
        hasNextPage:
          type: boolean
      required:
      - data
      - nextCursor
      - previousCursor
      - hasNextPage
    Trend:
      type: object
      properties:
        name:
          type: string
        query:
          type: string
          description: URL-decoded
        url:
          type: string
        tweetVolume:
          type:
          - integer
          - 'null'
      required:
      - name
      - query
      - url
      - tweetVolume
    TrendPage:
      type: object
      description: 'Simple format: trends (no cursor)'
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Trend'
        nextCursor:
          type:
          - string
          - 'null'
          description: Pass as cursor for the next page; null on the last page
        previousCursor:
          type:
          - string
          - 'null'
          description: X's top cursor, for polling newer items
        hasNextPage:
          type: boolean
      required:
      - data
      - nextCursor
      - previousCursor
      - hasNextPage
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key from the dashboard (https://app.twittrapi.com/register).
externalDocs:
  description: Documentation
  url: https://www.twittrapi.com/docs