> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bridgly.app/llms.txt
> Use this file to discover all available pages before exploring further.

# List an X user's media tweets



## OpenAPI

````yaml /openapi.json post /x/get-user-media
openapi: 3.1.0
info:
  title: Bridgly API
  description: >-
    Web scraping API for LinkedIn, X (Twitter) and Reddit. Authenticated
    endpoints accept a Bridgly API key (`bgly_…`) via `Authorization: Bearer
    <token>`.
  version: 1.0.0
servers:
  - url: https://api.bridgly.app
    description: Production
security: []
tags:
  - name: LinkedIn
    description: Scrape LinkedIn profiles, companies, posts, and search.
  - name: Reddit
    description: Scrape Reddit posts, subreddits, users, and search.
  - name: X (Twitter)
    description: Scrape tweets and search X.
paths:
  /x/get-user-media:
    post:
      tags:
        - X (Twitter)
      summary: List an X user's media tweets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  description: >-
                    Numeric user ID (rest_id) whose tweets to list, e.g.
                    "44196397".
                count:
                  default: 10
                  description: Number of tweets to return per page (1–10). Defaults to 10.
                  type: integer
                  minimum: 1
                  maximum: 10
                cursor:
                  description: >-
                    Pagination cursor from a previous response's `nextCursor` to
                    fetch the next page.
                  type: string
              required:
                - userId
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  timeMs:
                    type: number
                    description: >-
                      Wall-clock time the request took to complete, in
                      milliseconds.
                  creditsCost:
                    type: number
                    description: Number of account credits this request consumed.
                  data:
                    type: object
                    properties:
                      tweets:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Numeric tweet ID
                            url:
                              type: string
                              description: >-
                                Canonical tweet URL e.g.
                                "https://x.com/elonmusk/status/123"
                            text:
                              type: string
                              description: Full text of the tweet
                            author:
                              type: object
                              properties:
                                userId:
                                  type: string
                                username:
                                  type: string
                                  description: Handle without the @ e.g. "elonmusk"
                                profileUrl:
                                  type: string
                                  description: >-
                                    Canonical profile URL e.g.
                                    "https://x.com/elonmusk"
                                displayName:
                                  type: string
                                bio:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                avatarUrl:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                bannerUrl:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                  description: Profile banner image URL
                                location:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                  description: Self-reported location
                                followerCount:
                                  type: number
                                followingCount:
                                  type: number
                                tweetCount:
                                  anyOf:
                                    - type: number
                                    - type: 'null'
                                  description: Number of tweets posted (statuses_count)
                                mediaCount:
                                  anyOf:
                                    - type: number
                                    - type: 'null'
                                  description: Number of media items posted
                                likeCount:
                                  anyOf:
                                    - type: number
                                    - type: 'null'
                                  description: Number of tweets liked (favourites_count)
                                listedCount:
                                  anyOf:
                                    - type: number
                                    - type: 'null'
                                  description: Number of lists the user appears on
                                pinnedTweetId:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                  description: >-
                                    Numeric ID of the pinned tweet — resolve via
                                    the tweet endpoint
                                pinnedTweetUrl:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                  description: Canonical URL of the pinned tweet
                                createdAt:
                                  anyOf:
                                    - type: string
                                      format: date-time
                                    - type: 'null'
                                  description: When the account was created
                                createdAtEpochMs:
                                  anyOf:
                                    - type: number
                                    - type: 'null'
                                  description: >-
                                    When the account was created, as a Unix
                                    epoch in milliseconds
                                isVerified:
                                  type: boolean
                                isBlueVerified:
                                  type: boolean
                              required:
                                - userId
                                - username
                                - profileUrl
                                - displayName
                                - bio
                                - avatarUrl
                                - bannerUrl
                                - location
                                - followerCount
                                - followingCount
                                - tweetCount
                                - mediaCount
                                - likeCount
                                - listedCount
                                - pinnedTweetId
                                - pinnedTweetUrl
                                - createdAt
                                - createdAtEpochMs
                                - isVerified
                                - isBlueVerified
                              additionalProperties: false
                            createdAt:
                              description: When the tweet was posted
                              type: string
                              format: date-time
                            createdAtEpochMs:
                              type: number
                              description: >-
                                When the tweet was posted, as a Unix epoch in
                                milliseconds
                            source:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Client app the tweet was posted from e.g.
                                "Twitter for iPhone"
                            conversationId:
                              type: string
                              description: ID of the root tweet in this thread
                            replyCount:
                              type: number
                            retweetCount:
                              type: number
                            likeCount:
                              type: number
                            quoteCount:
                              type: number
                            bookmarkCount:
                              anyOf:
                                - type: number
                                - type: 'null'
                            viewCount:
                              anyOf:
                                - type: number
                                - type: 'null'
                            replyToTweetId:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Parent tweet ID if this is a reply
                            replyToUserId:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Author of the parent tweet
                            replyToUsername:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Handle of the parent tweet author if this is a
                                reply
                            replyToTweetUrl:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Canonical URL of the parent tweet if this is a
                                reply
                            isQuote:
                              type: boolean
                              description: Whether this tweet quotes another tweet
                            quotedTweetId:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                ID of the quoted tweet — resolve via the tweet
                                endpoint
                            quotedTweetUrl:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Canonical URL of the quoted tweet
                            quotedTweetAuthorId:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Numeric user ID of the quoted tweet author
                            quotedTweetAuthorUsername:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Handle of the quoted tweet author
                            retweetedTweetId:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                ID of the original tweet when this entry is a
                                retweet
                            retweetedTweetUrl:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Canonical URL of the original tweet when this is
                                a retweet
                            retweetedTweetAuthorId:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Numeric user ID of the original tweet author
                                when a retweet
                            retweetedTweetAuthorUsername:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: >-
                                Handle of the original tweet author when a
                                retweet
                            lang:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Language code e.g. "en"
                            isSensitive:
                              type: boolean
                            hashtags:
                              type: array
                              items:
                                type: string
                              description: 'Hashtag text without the # symbol'
                            mentions:
                              type: array
                              items:
                                type: object
                                properties:
                                  userId:
                                    type: string
                                  username:
                                    type: string
                                  displayName:
                                    type: string
                                  profileUrl:
                                    type: string
                                    description: >-
                                      Canonical profile URL of the mentioned
                                      user
                                required:
                                  - userId
                                  - username
                                  - displayName
                                  - profileUrl
                                additionalProperties: false
                            urls:
                              type: array
                              items:
                                type: object
                                properties:
                                  shortUrl:
                                    type: string
                                    description: t.co short URL as it appears in the text
                                  expandedUrl:
                                    type: string
                                    description: The actual destination URL
                                  displayUrl:
                                    type: string
                                    description: Human-readable label e.g. "github.com/..."
                                required:
                                  - shortUrl
                                  - expandedUrl
                                  - displayUrl
                                additionalProperties: false
                            media:
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - photo
                                      - video
                                      - animated_gif
                                  url:
                                    type: string
                                    description: >-
                                      Preview / thumbnail image URL
                                      (media_url_https)
                                  mediaKey:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    description: Stable media identifier (media_key)
                                  mediaId:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    description: >-
                                      Numeric media ID (id_str) — stable
                                      identifier of the media item
                                  width:
                                    anyOf:
                                      - type: number
                                      - type: 'null'
                                    description: >-
                                      Native pixel width of the media; null when
                                      unknown
                                  height:
                                    anyOf:
                                      - type: number
                                      - type: 'null'
                                    description: >-
                                      Native pixel height of the media; null
                                      when unknown
                                  expandedUrl:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    description: Canonical URL of this media on the tweet
                                  videoUrl:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                    description: >-
                                      Highest-quality MP4 URL for video / GIF
                                      media; null for photos
                                  durationMs:
                                    anyOf:
                                      - type: number
                                      - type: 'null'
                                    description: >-
                                      Video / GIF duration in milliseconds; null
                                      for photos
                                required:
                                  - type
                                  - url
                                  - mediaKey
                                  - mediaId
                                  - width
                                  - height
                                  - expandedUrl
                                  - videoUrl
                                  - durationMs
                                additionalProperties: false
                          required:
                            - id
                            - url
                            - text
                            - author
                            - createdAt
                            - createdAtEpochMs
                            - source
                            - conversationId
                            - replyCount
                            - retweetCount
                            - likeCount
                            - quoteCount
                            - bookmarkCount
                            - viewCount
                            - replyToTweetId
                            - replyToUserId
                            - replyToUsername
                            - replyToTweetUrl
                            - isQuote
                            - quotedTweetId
                            - quotedTweetUrl
                            - quotedTweetAuthorId
                            - quotedTweetAuthorUsername
                            - retweetedTweetId
                            - retweetedTweetUrl
                            - retweetedTweetAuthorId
                            - retweetedTweetAuthorUsername
                            - lang
                            - isSensitive
                            - hashtags
                            - mentions
                            - urls
                            - media
                          additionalProperties: false
                        description: Tweets on this page of the user timeline, newest first
                      nextCursor:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: >-
                          Cursor for the next page; null when the timeline is
                          exhausted
                    required:
                      - tweets
                      - nextCursor
                    additionalProperties: false
                required:
                  - timeMs
                  - creditsCost
                  - data
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '402':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                    description: Human-readable description of what went wrong.
                required:
                  - status
                  - message
                additionalProperties: false
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: Bridgly SDK
          source: |-
            import { Bridgly } from 'bridgly';

            const client = new Bridgly({ apiKey: process.env.BRIDGLY_API_KEY });

            const res = await client.x.getUserMedia({
              userId: "string",
              count: 10,
            });
            if (res.type === 'success') console.log(res.data);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Bridgly API key (`bgly_…`). Metered endpoints deduct credits from the
        resolved account.

````