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

# Affilates

<div className="inline-flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">
  <span className="text-base">🪙</span>
  <span className="text-sm font-medium text-yellow-900 dark:text-yellow-100"><span className="font-semibold">1 credit</span><span className="text-yellow-700 dark:text-yellow-300 ml-1">per request</span></span>
</div>

## Copy for AI

<div className="my-6 rounded-xl border border-gray-200 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-900/40">
  <div className="min-w-0">
    <p className="text-base font-semibold text-gray-900 dark:text-gray-100">🤖 Why Code When AI Can Do It For You?</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">Stop writing code like it's 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.</p>
  </div>

  <div className="mt-4">
    <button
      type="button"
      className="inline-flex items-center gap-2 rounded-md border border-emerald-300 bg-emerald-50 px-3 py-2 text-sm font-medium text-emerald-800 hover:bg-emerald-100 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-100 dark:hover:bg-emerald-900/50"
      onClick={() => navigator.clipboard.writeText(`I want to make an API call to https://api.keyapi.ai/v1/twitter/affilates.

Please help me write code to make this API call and handle the response appropriately. Include error handling and best practices.

Here are the details:

Endpoint: GET https://api.keyapi.ai/v1/twitter/affilates

Description: Affilates

Required Headers:
--header 'Authorization: Bearer <YOUR_API_KEY>'

Parameters:
- screenname (Required): . Example: x
- cursor (Optional): 

Example Response:
{
"code": 0,
"message": "success",
"data": {
"affilates": [
  {
    "user_id": "44196397",
    "screen_name": "elonmusk",
    "description": "https://t.co/dDtDyVssfm",
    "profile_image": null,
    "statuses_count": 102411,
    "followers_count": 239947613,
    "friends_count": 1325,
    "media_count": 4487,
    "name": "Elon Musk"
  },
  {
    "user_id": "1076061",
    "screen_name": "kcoleman",
    "description": "VP Product @X. Previously CEO at Yes Inc, @google 🙌",
    "profile_image": null,
    "statuses_count": 3152,
    "followers_count": 38110,
    "friends_count": 900,
    "media_count": 237,
    "name": "Keith Coleman 🌱😀🙌"
  },
  {
    "user_id": "2022661",
    "screen_name": "swolek",
    "description": "Brand Partnerships @X. Syracuse @NewhouseSU alum. Lifelong @Seminoles fan. Washed former hooper and proud #girldad.",
    "profile_image": null,
    "statuses_count": 980,
    "followers_count": 1440,
    "friends_count": 316,
    "media_count": 50,
    "name": "Stephen Wolek"
  },
  {
    "user_id": "6102602",
    "screen_name": "stephterroir",
    "description": "@X // Brand Strategy | IA | UX | UI - Certified LEGO Serious Play facilitator - ❤︎ Design, Data viz, Open web, EDM - #GoBlue!",
    "profile_image": null,
    "statuses_count": 27059,
    "followers_count": 9079,
    "friends_count": 1469,
    "media_count": 1248,
    "name": "Stephanie Terroir"
  },
  {
    "user_id": "6253282",
    "screen_name": "API",
    "description": "Updates about X API changes and service issues.",
    "profile_image": null,
    "statuses_count": 3755,
    "followers_count": 4945372,
    "friends_count": 12,
    "media_count": 9,
    "name": "API"
  },
  {
    "user_id": "6844292",
    "screen_name": "Engineering",
    "descri
... (truncated)`)}
    >
      <span>✨</span>
      <span>Copy for AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml en/twitter.openapi.json GET /v1/twitter/affilates
openapi: 3.0.1
info:
  title: Twitter/X API english documentation
  description: >-
    The english reference documentation of the Twitter/X API includes the
    interface's purpose, parameter description, response status, and sample
    structure.
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Twitter/X
security:
  - JWT Bearer: []
tags: []
paths:
  /v1/twitter/affilates:
    get:
      tags: []
      summary: Affilates
      parameters:
        - name: screenname
          in: query
          description: ''
          required: true
          example: x
          schema:
            type: string
            example: x
        - name: cursor
          in: query
          description: ''
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  affilates:
                    - user_id: '44196397'
                      screen_name: elonmusk
                      description: https://t.co/dDtDyVssfm
                      profile_image: null
                      statuses_count: 102411
                      followers_count: 239947613
                      friends_count: 1325
                      media_count: 4487
                      name: Elon Musk
                    - user_id: '1076061'
                      screen_name: kcoleman
                      description: VP Product @X. Previously CEO at Yes Inc, @google 🙌
                      profile_image: null
                      statuses_count: 3152
                      followers_count: 38110
                      friends_count: 900
                      media_count: 237
                      name: Keith Coleman 🌱😀🙌
                    - user_id: '2022661'
                      screen_name: swolek
                      description: >-
                        Brand Partnerships @X. Syracuse @NewhouseSU alum.
                        Lifelong @Seminoles fan. Washed former hooper and proud
                        #girldad.
                      profile_image: null
                      statuses_count: 980
                      followers_count: 1440
                      friends_count: 316
                      media_count: 50
                      name: Stephen Wolek
                    - user_id: '6102602'
                      screen_name: stephterroir
                      description: >-
                        @X // Brand Strategy | IA | UX | UI - Certified LEGO
                        Serious Play facilitator - ❤︎ Design, Data viz, Open
                        web, EDM - #GoBlue!
                      profile_image: null
                      statuses_count: 27059
                      followers_count: 9079
                      friends_count: 1469
                      media_count: 1248
                      name: Stephanie Terroir
                    - user_id: '6253282'
                      screen_name: API
                      description: Updates about X API changes and service issues.
                      profile_image: null
                      statuses_count: 3755
                      followers_count: 4945372
                      friends_count: 12
                      media_count: 9
                      name: API
                    - user_id: '6844292'
                      screen_name: Engineering
                      description: updates from our engineering team
                      profile_image: null
                      statuses_count: 1143
                      followers_count: 1305331
                      friends_count: 6
                      media_count: 68
                      name: Engineering
                    - user_id: '7080152'
                      screen_name: XcorpJP
                      description: |-
                        日本のX公式アカウントです。
                        Xの最新情報について発信しています。
                      profile_image: null
                      statuses_count: 13201
                      followers_count: 1950002
                      friends_count: 12
                      media_count: 1228
                      name: X Corp. Japan
                    - user_id: '10192452'
                      screen_name: federico
                      description: >-
                        Help brands grow @X ~ Ex @Twitter  @Linkedin @Microsoft
                        ~ Love clothes with dots and music with violins. Running
                        sometimes.
                      profile_image: null
                      statuses_count: 2616
                      followers_count: 7326
                      friends_count: 3511
                      media_count: 12
                      name: Federico Paderni
                    - user_id: '14803701'
                      screen_name: Pro
                      description: A powerful, real-time tool for people who live on X.
                      profile_image: null
                      statuses_count: 7872
                      followers_count: 1930756
                      friends_count: 126672
                      media_count: 80
                      name: Pro
                    - user_id: '14832852'
                      screen_name: laurentbuanec
                      description: >-
                        Working here📍 Au menu : 𝕏 , marketing, creativity,
                        innovation. Side dishes : music, photography, gaming,
                        sports.
                      profile_image: null
                      statuses_count: 13679
                      followers_count: 9070
                      friends_count: 534
                      media_count: 3327
                      name: LAURΞNT BUANΞC
                    - user_id: '15133481'
                      screen_name: BabyModeuse
                      description: >-
                        Global Luxury Strategy Lead @X @XAI 💎- @XFashion 👠 -
                        @CELSA_Officiel Alumni - Formerly @vestiaireco
                        @lofficielparis @JalouseMag @Vallee_Village
                      profile_image: null
                      statuses_count: 14704
                      followers_count: 9844
                      friends_count: 1786
                      media_count: 1472
                      name: Florence Best
                    - user_id: '15239801'
                      screen_name: michaelpalombo
                      description: Content Partnerships @X
                      profile_image: null
                      statuses_count: 1249
                      followers_count: 1604
                      friends_count: 1432
                      media_count: 293
                      name: Michael Palombo
                    - user_id: '15302228'
                      screen_name: RosemarieE
                      description: Media Strategy Lead for X. Lover of shiny things.
                      profile_image: null
                      statuses_count: 4644
                      followers_count: 2016
                      friends_count: 2142
                      media_count: 127
                      name: Rosemarie Esposito
                    - user_id: null
                      screen_name: null
                      description: null
                      profile_image: null
                      statuses_count: null
                      followers_count: null
                      friends_count: null
                      media_count: null
                      name: null
                    - user_id: '16483530'
                      screen_name: SophieTrinder
                      description: >-
                        Spending adult life figuring out why we are all here
                        doing what we are doing. Head of Brand Strategy at X UK.
                      profile_image: null
                      statuses_count: 2546
                      followers_count: 1795
                      friends_count: 1599
                      media_count: 338
                      name: SophieTrinder 💡
                    - user_id: '16971496'
                      screen_name: amandanogueira
                      description: Full-time curious.
                      profile_image: null
                      statuses_count: 6333
                      followers_count: 609
                      friends_count: 1408
                      media_count: 241
                      name: Amanda N.
                    - user_id: '17373231'
                      screen_name: arobinson16
                      description: ''
                      profile_image: null
                      statuses_count: 79
                      followers_count: 603
                      friends_count: 144
                      media_count: 5
                      name: Andrew Robinson
                    - user_id: '17843986'
                      screen_name: jhammerman
                      description: >-
                        Early riser. Platform junkie. Fan of progress and great
                        hair.
                      profile_image: null
                      statuses_count: 1530
                      followers_count: 637
                      friends_count: 573
                      media_count: 38
                      name: Judith_X
                    - user_id: null
                      screen_name: null
                      description: null
                      profile_image: null
                      statuses_count: null
                      followers_count: null
                      friends_count: null
                      media_count: null
                      name: null
                    - user_id: '18248178'
                      screen_name: b_tucker
                      description: >-
                        software engineer @ 𝕏


                        ubc grad, boston sports fan, way too curious to be a
                        cat.
                      profile_image: null
                      statuses_count: 1378
                      followers_count: 637
                      friends_count: 279
                      media_count: 36
                      name: Ben Tucker
                    - user_id: '18353485'
                      screen_name: ReemSadek
                      description: '@X @GlobalAffairs - MENA'
                      profile_image: null
                      statuses_count: 257
                      followers_count: 834
                      friends_count: 554
                      media_count: 26
                      name: Reem Sadek
                  next_cursor: DAAHCgABHIK05_A__-sLAAIAAAAIMTgzNTM0ODUIAAMAAAACAAA
                requestId: ad1156fd-ad46-4ff0-a420-98c413f6ec2a
          headers: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 400
                  data: null
                  message: Missing required parameter
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  data: null
                  message: apiKey is null
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 402
                  data: null
                  message: apiKey quota is not enough
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 429
                  data: null
                  message: qps limit exceeded
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  data: null
                  message: Internal server error
      deprecated: false
      security:
        - JWT Bearer: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.keyapi.ai/v1/twitter/affilates?screenname=x' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/twitter/affilates',
                params={"screenname": "x"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"screenname": "x"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/twitter/affilates?${params}`, {
              method: 'GET',
              headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
            });

            const data = await response.json();

            console.log(data);
components:
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        API key for authentication. Format: `sk_live_xxxxxxxxxxxxx`
        Get your API key from the [Dashboard](http://keyapi.ai/app/dashboard).

````