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

# /twitter/user/posts

> Twitter Get User Posts

**Price:** 1 credit per 20 results

**⚠️ Common errors:** 412: User not found. Verify the username.



## OpenAPI

````yaml /openapi/social-media.json post /api/twitter/user/posts
openapi: 3.1.0
info:
  title: Any Site API
  description: >+
    Any Site API provides programmatic access to data from LinkedIn, Instagram,
    Twitter, and other platforms.


    ## Authentication


    All API endpoints require an `access-token` header with a valid API token.
    Tokens can be created in the [dashboard](https://app.anysite.io/).


    ## Pricing


    Each endpoint has a credit cost listed in its description. Credits are
    deducted from your token balance per request.

  version: 0.0.1
servers: []
security:
  - AccessToken: []
paths:
  /api/twitter/user/posts:
    post:
      tags:
        - Twitter Users
      summary: /twitter/user/posts
      description: |-
        Twitter Get User Posts

        **Price:** 1 credit per 20 results

        **⚠️ Common errors:** 412: User not found. Verify the username.
      operationId: __api_twitter_user_posts_post
      parameters:
        - name: access-token
          in: header
          required: true
          schema:
            anyOf:
              - type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TwitterUserPostsPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TwitterPost'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TwitterUserPostsPayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          default: 300
        user:
          type: string
        count:
          type: integer
          exclusiveMinimum: 0
      type: object
      required:
        - user
        - count
    TwitterPost:
      properties:
        '@type':
          type: string
          default: TwitterPost
        id:
          type: string
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
        url:
          type: string
        text:
          type: string
        user:
          anyOf:
            - $ref: '#/components/schemas/TwitterPostUser'
            - type: 'null'
        retweet_count:
          type: integer
          default: 0
        favorite_count:
          type: integer
          default: 0
        reply_count:
          type: integer
          default: 0
        quote_count:
          type: integer
          default: 0
        view_count:
          anyOf:
            - type: string
            - type: 'null'
        is_retweet:
          type: boolean
          default: false
        retweeted:
          anyOf:
            - $ref: '#/components/schemas/TwitterPost'
            - type: 'null'
        is_quote:
          type: boolean
          default: false
        quoted:
          anyOf:
            - $ref: '#/components/schemas/TwitterPost'
            - type: 'null'
        in_reply_to_status_id:
          anyOf:
            - type: string
            - type: 'null'
        in_reply_to_user_id:
          anyOf:
            - type: string
            - type: 'null'
        in_reply_to_screen_name:
          anyOf:
            - type: string
            - type: 'null'
        lang:
          anyOf:
            - type: string
            - type: 'null'
        source:
          anyOf:
            - type: string
            - type: 'null'
        possibly_sensitive:
          type: boolean
          default: false
        medias:
          items:
            $ref: '#/components/schemas/TwitterMedia'
          type: array
          default: []
        urls:
          items:
            $ref: '#/components/schemas/TwitterUrl'
          type: array
          default: []
        hashtags:
          items:
            $ref: '#/components/schemas/TwitterHashtag'
          type: array
          default: []
        user_mentions:
          items:
            $ref: '#/components/schemas/TwitterPostUserMention'
          type: array
          default: []
        card:
          anyOf:
            - $ref: '#/components/schemas/TwitterCardInfo'
            - type: 'null'
        poll:
          anyOf:
            - $ref: '#/components/schemas/TwitterPoll'
            - type: 'null'
      type: object
      required:
        - id
        - url
        - text
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    TwitterPostUser:
      properties:
        '@type':
          type: string
          default: TwitterPostUser
        rest_id:
          type: string
        name:
          type: string
        alias:
          type: string
        url:
          type: string
        image:
          anyOf:
            - type: string
            - type: 'null'
        verified:
          type: boolean
          default: false
        verified_type:
          anyOf:
            - type: string
            - type: 'null'
        is_blue_verified:
          type: boolean
          default: false
      type: object
      required:
        - rest_id
        - name
        - alias
        - url
    TwitterMedia:
      properties:
        '@type':
          type: string
          default: TwitterMedia
        media_id:
          type: string
        media_url:
          anyOf:
            - type: string
            - type: 'null'
        type:
          anyOf:
            - type: string
            - type: 'null'
        width:
          anyOf:
            - type: integer
            - type: 'null'
        height:
          anyOf:
            - type: integer
            - type: 'null'
        alt_text:
          anyOf:
            - type: string
            - type: 'null'
        preview_image_url:
          anyOf:
            - type: string
            - type: 'null'
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
        video_url:
          anyOf:
            - type: string
            - type: 'null'
        expanded_url:
          anyOf:
            - type: string
            - type: 'null'
        allow_download:
          type: boolean
          default: true
        source_user_id:
          anyOf:
            - type: string
            - type: 'null'
        source_status_id:
          anyOf:
            - type: string
            - type: 'null'
      type: object
      required:
        - media_id
    TwitterUrl:
      properties:
        '@type':
          type: string
          default: TwitterUrl
        display_url:
          type: string
        expanded_url:
          type: string
        url:
          type: string
        indices:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
      type: object
      required:
        - display_url
        - expanded_url
        - url
    TwitterHashtag:
      properties:
        '@type':
          type: string
          default: TwitterHashtag
        text:
          type: string
        indices:
          items:
            type: integer
          type: array
          default: []
      type: object
      required:
        - text
    TwitterPostUserMention:
      properties:
        '@type':
          type: string
          default: TwitterPostUserMention
        user_id:
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
        alias:
          type: string
        url:
          type: string
        indices:
          items:
            type: integer
          type: array
          default: []
      type: object
      required:
        - user_id
        - alias
        - url
    TwitterCardInfo:
      properties:
        '@type':
          type: string
          default: TwitterCardInfo
        domain:
          anyOf:
            - type: string
            - type: 'null'
        vanity_url:
          anyOf:
            - type: string
            - type: 'null'
        image_url:
          anyOf:
            - type: string
            - type: 'null'
        url:
          anyOf:
            - type: string
            - type: 'null'
        card_type:
          anyOf:
            - type: string
            - type: 'null'
      type: object
    TwitterPoll:
      properties:
        '@type':
          type: string
          default: TwitterPoll
        choices:
          items:
            $ref: '#/components/schemas/TwitterPollChoice'
          type: array
          default: []
        ended_at:
          anyOf:
            - type: integer
            - type: 'null'
        duration_minutes:
          type: integer
          default: 0
        is_final:
          type: boolean
          default: false
        last_updated_at:
          anyOf:
            - type: integer
            - type: 'null'
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
        input: {}
        ctx:
          type: object
      type: object
      required:
        - loc
        - msg
        - type
    TwitterPollChoice:
      properties:
        '@type':
          type: string
          default: TwitterPollChoice
        label:
          type: string
        count:
          type: integer
          default: 0
        percentage:
          type: number
          default: 0
      type: object
      required:
        - label
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: access-token
      description: API token from the dashboard

````