> ## 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/search/posts

> Twitter Search Tweets

**Price:** 1 credit per 20 results



## OpenAPI

````yaml /openapi/social-media.json post /api/twitter/search/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/search/posts:
    post:
      tags:
        - Twitter Search
      summary: /twitter/search/posts
      description: |-
        Twitter Search Tweets

        **Price:** 1 credit per 20 results
      operationId: __api_twitter_search_posts_post
      parameters:
        - name: access-token
          in: header
          required: true
          schema:
            anyOf:
              - type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TwitterSearchPostsPayload'
      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:
    TwitterSearchPostsPayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          default: 300
        query:
          type: string
          default: ''
        exact_phrase:
          type: string
          default: ''
        any_of_these_words:
          anyOf:
            - items:
                type: string
              type: array
              uniqueItems: true
            - type: 'null'
        none_of_these_words:
          anyOf:
            - items:
                type: string
              type: array
              uniqueItems: true
            - type: 'null'
        these_hashtags:
          anyOf:
            - items:
                type: string
              type: array
              uniqueItems: true
            - type: 'null'
        language:
          anyOf:
            - type: string
              enum:
                - Arabic
                - Arabic (Feminine)
                - Bangla
                - Basque
                - Bulgarian
                - Catalan
                - Croatian
                - Czech
                - Danish
                - Dutch
                - English
                - Finnish
                - French
                - German
                - Greek
                - Gujarati
                - Hebrew
                - Hindi
                - Hungarian
                - Indonesian
                - Italian
                - Japanese
                - Kannada
                - Korean
                - Marathi
                - Norwegian
                - Persian
                - Polish
                - Portuguese
                - Romanian
                - Russian
                - Serbian
                - Simplified Chinese
                - Slovak
                - Spanish
                - Swedish
                - Tamil
                - Thai
                - Traditional Chinese
                - Turkish
                - Ukrainian
                - Urdu
                - Vietnamese
            - type: 'null'
        from_these_accounts:
          anyOf:
            - items:
                type: string
              type: array
              uniqueItems: true
            - type: 'null'
        to_these_accounts:
          anyOf:
            - items:
                type: string
              type: array
              uniqueItems: true
            - type: 'null'
        mentioning_these_accounts:
          anyOf:
            - items:
                type: string
              type: array
              uniqueItems: true
            - type: 'null'
        min_replies:
          anyOf:
            - type: integer
            - type: 'null'
        min_likes:
          anyOf:
            - type: integer
            - type: 'null'
        min_retweets:
          anyOf:
            - type: integer
            - type: 'null'
        from_date:
          anyOf:
            - type: integer
              exclusiveMinimum: 1136073600
            - type: 'null'
        to_date:
          anyOf:
            - type: integer
              exclusiveMinimum: 1136073600
            - type: 'null'
        search_type:
          $ref: '#/components/schemas/TwitterSearchPostsType'
          default: Top
        media_type:
          $ref: '#/components/schemas/TwitterSearchMediaType'
          default: any
        count:
          type: integer
          exclusiveMinimum: 0
      type: object
      required:
        - 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
    TwitterSearchPostsType:
      type: string
      enum:
        - Top
        - Latest
        - Media
    TwitterSearchMediaType:
      type: string
      enum:
        - any
        - images
        - videos
    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

````