> ## 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.

# Spaces info

<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/spaces.

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/spaces

Description: Spaces info

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

Parameters:
- id (Required): . Example: 1yoJMwpbmaXKQ

Example Response:
{
"code": 0,
"message": "success",
"data": {
"state": "Ended",
"id": "1yoJMwpbmaXKQ",
"ended": "1712035727255",
"started": 1712011212266,
"locked": false,
"replay_start_time": null,
"total_live_listeners": 1284588,
"total_replay_watched": 210,
"content_type": "visual_audio",
"is_space_available_for_replay": true,
"media_key": "28_1774929779223080960",
"replay_available": true,
"participants": {
  "admins": [
    {
      "avatar": "https://pbs.twimg.com/profile_images/2038482322371297280/Nrz7f89x_normal.jpg",
      "display_name": "Bark",
      "is_verified": true,
      "is_blue_verified": true,
      "periscope_user_id": "1zYKbeqYpyQex",
      "screenname": "barkmeta",
      "rest_id": "336348053"
    }
  ],
  "speakers": [
    {
      "avatar": "https://pbs.twimg.com/profile_images/2037283714225569792/lz8UC6hl_normal.jpg",
      "display_name": "Alex 🥷",
      "is_verified": true,
      "periscope_user_id": "1ayjVrNWqmZjp",
      "is_blue_verified": true,
      "screenname": "Shilllin",
      "rest_id": "1064982684060057606"
    },
    {
      "avatar": "https://pbs.twimg.com/profile_images/1971451052793761792/CRZhOHRx_normal.jpg",
      "display_name": "Books",
      "is_verified": true,
      "periscope_user_id": "1DZEoJOyMBYja",
      "is_blue_verified": true,
      "screenname": "Booksey",
      "rest_id": "314560827"
    },
    {
      "avatar": "https://pbs.twimg.com/profile_images/1977565948921233408/psUAzCMv_normal.jpg",
      "display_name": "Joey Hickson",
      "is_verified": true,
      "periscope_user_id": "1DYKXLnDgLqKg",
      "is_blue_verified": true,
      "screenname": "joeyhickson",
      "rest_id": "2467057448"
    },
    {
      "avatar": "https://pbs.twimg.com/profile_images/2038641501962649600/Tf0a6fWA_normal.jpg",
    
... (truncated)`)}
    >
      <span>✨</span>
      <span>Copy for AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml en/twitter.openapi.json GET /v1/twitter/spaces
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/spaces:
    get:
      tags: []
      summary: Spaces info
      parameters:
        - name: id
          in: query
          description: ''
          required: true
          example: 1yoJMwpbmaXKQ
          schema:
            type: string
            example: 1yoJMwpbmaXKQ
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  state: Ended
                  id: 1yoJMwpbmaXKQ
                  ended: '1712035727255'
                  started: 1712011212266
                  locked: false
                  replay_start_time: null
                  total_live_listeners: 1284588
                  total_replay_watched: 210
                  content_type: visual_audio
                  is_space_available_for_replay: true
                  media_key: '28_1774929779223080960'
                  replay_available: true
                  participants:
                    admins:
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2038482322371297280/Nrz7f89x_normal.jpg
                        display_name: Bark
                        is_verified: true
                        is_blue_verified: true
                        periscope_user_id: 1zYKbeqYpyQex
                        screenname: barkmeta
                        rest_id: '336348053'
                    speakers:
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2037283714225569792/lz8UC6hl_normal.jpg
                        display_name: Alex 🥷
                        is_verified: true
                        periscope_user_id: 1ayjVrNWqmZjp
                        is_blue_verified: true
                        screenname: Shilllin
                        rest_id: '1064982684060057606'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1971451052793761792/CRZhOHRx_normal.jpg
                        display_name: Books
                        is_verified: true
                        periscope_user_id: 1DZEoJOyMBYja
                        is_blue_verified: true
                        screenname: Booksey
                        rest_id: '314560827'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1977565948921233408/psUAzCMv_normal.jpg
                        display_name: Joey Hickson
                        is_verified: true
                        periscope_user_id: 1DYKXLnDgLqKg
                        is_blue_verified: true
                        screenname: joeyhickson
                        rest_id: '2467057448'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2038641501962649600/Tf0a6fWA_normal.jpg
                        display_name: Shibo
                        is_verified: true
                        periscope_user_id: 1oNQlYBZManKw
                        is_blue_verified: true
                        screenname: GodsBurnt
                        rest_id: '1547753041092231168'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2036548995947134976/1myihBd2_normal.jpg
                        display_name: fity.eth
                        is_verified: true
                        periscope_user_id: 1oNjlvewARaQw
                        is_blue_verified: true
                        screenname: Fityeth
                        rest_id: '1431423782900621314'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2044948839904215041/pd-XwFRu_normal.jpg
                        display_name: Ant
                        is_verified: true
                        periscope_user_id: 1DLKBnxebLmKJ
                        is_blue_verified: true
                        screenname: KingAnt
                        rest_id: '1433178538228822022'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2036768438614720512/OTXCSv4B_normal.jpg
                        display_name: 212.21 Million
                        is_verified: true
                        periscope_user_id: 1eRKxezYvyrjw
                        is_blue_verified: true
                        screenname: Blockchainwork5
                        rest_id: '1440343408850051086'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2046214894752514049/GwphD8iv_normal.jpg
                        display_name: Web
                        is_verified: true
                        periscope_user_id: 1WLERbMWDkWEb
                        is_blue_verified: true
                        screenname: web3smb
                        rest_id: '832980412452503556'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2036942404675112960/vshRy36N_normal.jpg
                        display_name: Hofer
                        is_verified: true
                        periscope_user_id: 1DLKBOlmrbpjJ
                        is_blue_verified: true
                        screenname: Hofers
                        rest_id: '1053309451'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1970712184947908608/Fd6vdDf0_normal.jpg
                        display_name: MferJo
                        is_verified: true
                        periscope_user_id: 1oNQlkvkLdpEw
                        is_blue_verified: true
                        screenname: Astercoded69
                        rest_id: '1365479477006929922'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2054343591984779264/kMRUQYY6_normal.jpg
                        display_name: mav
                        is_verified: true
                        periscope_user_id: 1zvKNZnrLrRKe
                        is_blue_verified: true
                        screenname: MissMav87
                        rest_id: '1155541058295439360'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2042926759306309633/-LhM9FYe_normal.jpg
                        display_name: Jonny
                        is_verified: true
                        periscope_user_id: 1xkjDxmeolejz
                        is_blue_verified: true
                        screenname: JonnyQ__
                        rest_id: '1026169340029292544'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1747388995691008000/DtiivqOq_normal.jpg
                        display_name: Ben
                        is_verified: true
                        periscope_user_id: 1eRExYpzwLmQw
                        is_blue_verified: true
                        screenname: BigBenBusiness
                        rest_id: '1352330322181021697'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2009916088390164481/bPh95Eou_normal.jpg
                        display_name: EazyPlayz
                        is_verified: true
                        periscope_user_id: 1pzQMLwWVdrEd
                        is_blue_verified: true
                        screenname: eazyplayz_
                        rest_id: '546379865'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2001100352473505795/8fvQ-rFh_normal.jpg
                        display_name: RTB 🇺🇸 || $fidgetybeast 🐍
                        is_verified: true
                        periscope_user_id: 1VGjvnzOJJZjO
                        is_blue_verified: true
                        screenname: Fidgetybeast
                        rest_id: '1341537806930354178'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1946670449540169728/0o6Sves7_normal.jpg
                        display_name: JAE
                        is_verified: true
                        periscope_user_id: 1VGjvBJWWDpjO
                        is_blue_verified: true
                        screenname: JaeMetaX
                        rest_id: '1628173831297695746'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1985088654696722432/xn04j50M_normal.jpg
                        display_name: Mopar 🇦🇺
                        is_verified: true
                        periscope_user_id: 1eWEyrkdlyZQA
                        is_blue_verified: true
                        screenname: MoparGirls
                        rest_id: '2856187290'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2054267350807937024/pxVhGgLR_normal.jpg
                        display_name: XRM
                        is_verified: true
                        periscope_user_id: 1lZEpDmpzXaEn
                        is_blue_verified: true
                        screenname: ZerpZoo
                        rest_id: '1323973267472994305'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1964378427449880576/GqjScc54_normal.jpg
                        display_name: BUFF
                        is_verified: true
                        periscope_user_id: 1eVQYwYVeajLO
                        is_blue_verified: true
                        screenname: Buffalomma8
                        rest_id: '349375010'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1784868446657728513/rbUrp2aJ_normal.jpg
                        display_name: DLuxx
                        is_verified: true
                        periscope_user_id: 1eRExlezVANEw
                        is_blue_verified: true
                        screenname: DLoz
                        rest_id: '19447793'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1989054450485571584/vahWnW2T_normal.jpg
                        display_name: KB 👊
                        is_verified: true
                        periscope_user_id: 1mMEPqDJeGWQG
                        is_blue_verified: true
                        screenname: KillerbunnyKBDS
                        rest_id: '1460782575140544516'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1971004967470116864/l4ShCsLK_normal.jpg
                        display_name: Drip
                        is_verified: true
                        periscope_user_id: 1WLERwXvZDPQb
                        is_blue_verified: true
                        screenname: drippysats
                        rest_id: '1300962221263118336'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2053176744455344128/7WwFAGxn_normal.jpg
                        display_name: bobo 👁️
                        is_verified: true
                        periscope_user_id: 1xeEWgDRnzpEP
                        is_blue_verified: true
                        screenname: TortillasTown
                        rest_id: '1705368385205522432'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2001015476751638529/KuGe1-bT_normal.jpg
                        display_name: starv3
                        is_verified: true
                        periscope_user_id: '14720132'
                        is_blue_verified: true
                        screenname: starv3meta
                        rest_id: '82413290'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1983058947780337664/D1_QuZ1B_normal.jpg
                        display_name: Nima Bayan⚡️🌞🦁
                        is_verified: true
                        periscope_user_id: '478686'
                        is_blue_verified: true
                        screenname: nimabuyin
                        rest_id: '277957012'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1803049766290440192/PlQcTO0x_normal.jpg
                        display_name: Trippy
                        is_verified: true
                        periscope_user_id: 1oPKLxdglxrKd
                        is_blue_verified: true
                        screenname: Trap3D
                        rest_id: '441218547'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1778889335690960896/2UJGBaFz_normal.jpg
                        display_name: StrFck3r
                        is_verified: true
                        periscope_user_id: 1eRKxqeegawjw
                        is_blue_verified: true
                        screenname: strfck3r
                        rest_id: '2792491415'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2014173113538199552/WTDiQWg3_normal.jpg
                        display_name: Ninja Turtle
                        is_verified: false
                        periscope_user_id: 1XJQkdXJWmXKL
                        is_blue_verified: true
                        screenname: NinjaTurtleX888
                        rest_id: '935885550'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1998069307637473283/0bL2ws_G_normal.jpg
                        display_name: patron
                        is_verified: false
                        periscope_user_id: 1mMKPrwmOvOEG
                        is_blue_verified: true
                        screenname: ALPHAisFREE
                        rest_id: '1445468116717215745'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1882859259718733824/2YW7SC7R_normal.png
                        display_name: Cardano Review 🐈‍⬛
                        is_verified: false
                        periscope_user_id: 1MWKwwWvrqZKb
                        is_blue_verified: true
                        screenname: CardanoReview
                        rest_id: '1668535260156420097'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2008698546678362113/yJmkwXYG_normal.jpg
                        display_name: Ceejay
                        is_verified: false
                        periscope_user_id: 1AmQzgXNqOdKe
                        is_blue_verified: true
                        screenname: CeejayX7
                        rest_id: '99565185'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1807805432913879040/zoV-KDSh_normal.jpg
                        display_name: Ren
                        is_verified: false
                        periscope_user_id: 1PmKqdGPpMeQo
                        is_blue_verified: true
                        screenname: ireneilicia
                        rest_id: '1359166813276356609'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2018880799777439744/2AooqDVH_normal.jpg
                        display_name: M7
                        is_verified: false
                        periscope_user_id: 1YLKJXqblwXEN
                        is_blue_verified: true
                        screenname: M7Investments
                        rest_id: '1325077675002748928'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1922376419742457857/sOr-jC2Y_normal.jpg
                        display_name: Red
                        is_verified: false
                        periscope_user_id: 1WgEgvGYpJgjv
                        is_blue_verified: true
                        screenname: OmarBuhxzx
                        rest_id: '3065996275'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1837313693262180352/z7dOKsQZ_normal.jpg
                        display_name: MOB
                        is_verified: false
                        periscope_user_id: tw-1451329588714303493
                        is_blue_verified: true
                        screenname: Mo41541
                        rest_id: '1451329588714303493'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1777861826413256704/OEP2-NKk_normal.jpg
                        display_name: Joey
                        is_verified: false
                        periscope_user_id: 1DZEopRvYplQa
                        is_blue_verified: true
                        screenname: Joeyon_X
                        rest_id: '1677148875126378496'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/2040032164146733056/D9vYBkQd_normal.jpg
                        display_name: Parlay
                        is_verified: false
                        periscope_user_id: 1YLEJeqzrkXjN
                        is_blue_verified: true
                        screenname: yngbnft3
                        rest_id: '1769426833592696832'
                      - avatar: >-
                          https://pbs.twimg.com/profile_images/1929757614994292736/yr6mxQy5_normal.jpg
                        display_name: Rangel
                        is_verified: false
                        periscope_user_id: tw-1256887864450670598
                        is_blue_verified: true
                        screenname: Rangel91009955
                        rest_id: '1256887864450670598'
                  community: false
                  creator:
                    avatar: null
                    display_name: Bark
                    is_blue_verified: true
                    screenname: barkmeta
                    followers_count: 291430
                    pinned_tweet_ids_str:
                      - '1896702771291926766'
                    rest_id: '336348053'
                  sharings: []
                  playlist: >-
                    https://prod-fastly-us-east-1.video.pscp.tv/Transcoding/v1/hls/TuGZupq0IW3JTw2-slEt_jGrNF8Rs59Rp0HLJcqd-IDA1RsF8APHPdaJx8fo2bEt-PteyXGtm_mMM8LdxDw0NQ/non_transcode/us-east-1/periscope-replay-direct-prod-us-east-1-public/audio-space/playlist_16734708395013829425.m3u8?type=replay
                  chunks_base_url: >-
                    https://prod-fastly-us-east-1.video.pscp.tv/Transcoding/v1/hls/TuGZupq0IW3JTw2-slEt_jGrNF8Rs59Rp0HLJcqd-IDA1RsF8APHPdaJx8fo2bEt-PteyXGtm_mMM8LdxDw0NQ/non_transcode/us-east-1/periscope-replay-direct-prod-us-east-1-public/audio-space/
                requestId: 0b64f757-8962-4c8e-a92d-0915dbe29d1f
          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/spaces?id=1yoJMwpbmaXKQ' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

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


            const response = await
            fetch(`https://api.keyapi.ai/v1/twitter/spaces?${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).

````