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

# त्वरित शुरुआत

> id या क्रिएटर के आधार पर Space का विवरण प्राप्त करें

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

यह मार्गदर्शिका आपको Spaces lookup endpoints का उपयोग करके Space की जानकारी प्राप्त करने का तरीका बताती है।

<Note>
  **पूर्वापेक्षाएँ**

  शुरू करने से पहले, आपके पास ये होने चाहिए:

  * एक स्वीकृत ऐप के साथ [डेवलपर खाता](https://developer.x.com/en/portal/petition/essential/basic-info)
  * आपके ऐप का बेयरर टोकन
</Note>

***

<div id="get-a-space-by-id">
  ## id द्वारा Space प्राप्त करें
</div>

किसी खास Space का विवरण प्राप्त करें:

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/spaces/1DXxyRYNejbKM?\
  space.fields=title,host_ids,participant_count,scheduled_start,state,created_at" \
    -H "Authorization: Bearer $BEARER_TOKEN"
  ```

  ```python Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # id द्वारा Space प्राप्त करें
  response = client.spaces.get(
      "1DXxyRYNejbKM",
      space_fields=["title", "host_ids", "participant_count", "scheduled_start", "state", "created_at"]
  )

  print(f"Space: {response.data.title}")
  print(f"State: {response.data.state}")
  print(f"Participants: {response.data.participant_count}")
  ```

  ```javascript JavaScript SDK theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ bearerToken: "YOUR_BEARER_TOKEN" });

  // id द्वारा Space प्राप्त करें
  const response = await client.spaces.get("1DXxyRYNejbKM", {
    spaceFields: ["title", "host_ids", "participant_count", "scheduled_start", "state", "created_at"],
  });

  console.log(`Space: ${response.data?.title}`);
  console.log(`State: ${response.data?.state}`);
  console.log(`Participants: ${response.data?.participant_count}`);
  ```
</CodeGroup>

<div id="response">
  ### रिस्पॉन्स
</div>

```json theme={null}
{
  "data": {
    "id": "1DXxyRYNejbKM",
    "state": "live",
    "title": "Discussing AI and the Future",
    "host_ids": ["2244994945"],
    "participant_count": 245,
    "created_at": "2024-01-15T09:00:00.000Z"
  }
}
```

***

<div id="get-multiple-spaces">
  ## एक साथ कई Spaces प्राप्त करें
</div>

एक साथ कई Spaces देखें:

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/spaces?\
  ids=1DXxyRYNejbKM,1YqJDqWYNQDGW&\
  space.fields=title,state,participant_count" \
    -H "Authorization: Bearer $BEARER_TOKEN"
  ```

  ```python Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # एक साथ कई Spaces प्राप्त करें
  response = client.spaces.get_spaces(
      ids=["1DXxyRYNejbKM", "1YqJDqWYNQDGW"],
      space_fields=["title", "state", "participant_count"]
  )

  for space in response.data:
      print(f"{space.title} - {space.state}")
  ```

  ```javascript JavaScript SDK theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ bearerToken: "YOUR_BEARER_TOKEN" });

  // एक साथ कई Spaces प्राप्त करें
  const response = await client.spaces.getSpaces({
    ids: ["1DXxyRYNejbKM", "1YqJDqWYNQDGW"],
    spaceFields: ["title", "state", "participant_count"],
  });

  response.data?.forEach((space) => {
    console.log(`${space.title} - ${space.state}`);
  });
  ```
</CodeGroup>

***

<div id="get-spaces-by-creator">
  ## क्रिएटर के आधार पर Spaces प्राप्त करें
</div>

विशिष्ट उपयोगकर्ताओं द्वारा होस्ट किए गए Spaces ढूँढें:

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/spaces/by/creator_ids?\
  user_ids=2244994945,783214&\
  space.fields=title,state,scheduled_start" \
    -H "Authorization: Bearer $BEARER_TOKEN"
  ```

  ```python Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # क्रिएटर के आधार पर Spaces प्राप्त करें
  response = client.spaces.get_by_creator_ids(
      user_ids=["2244994945", "783214"],
      space_fields=["title", "state", "scheduled_start"]
  )

  for space in response.data:
      print(f"{space.title} - {space.state}")
  ```

  ```javascript JavaScript SDK theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ bearerToken: "YOUR_BEARER_TOKEN" });

  // क्रिएटर के आधार पर Spaces प्राप्त करें
  const response = await client.spaces.getByCreatorIds({
    userIds: ["2244994945", "783214"],
    spaceFields: ["title", "state", "scheduled_start"],
  });

  response.data?.forEach((space) => {
    console.log(`${space.title} - ${space.state}`);
  });
  ```
</CodeGroup>

***

<div id="include-host-information">
  ## होस्ट की जानकारी शामिल करें
</div>

होस्ट उपयोगकर्ता डेटा विस्तारित करें:

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl "https://api.x.com/2/spaces/1DXxyRYNejbKM?\
  space.fields=title,host_ids,state&\
  expansions=host_ids&\
  user.fields=username,verified" \
    -H "Authorization: Bearer $BEARER_TOKEN"
  ```

  ```python Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_BEARER_TOKEN")

  # होस्ट जानकारी के साथ Space प्राप्त करें
  response = client.spaces.get(
      "1DXxyRYNejbKM",
      space_fields=["title", "host_ids", "state"],
      expansions=["host_ids"],
      user_fields=["username", "verified"]
  )

  print(f"Space: {response.data.title}")
  # होस्ट जानकारी response.includes.users में है
  ```

  ```javascript JavaScript SDK theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ bearerToken: "YOUR_BEARER_TOKEN" });

  // होस्ट जानकारी के साथ Space प्राप्त करें
  const response = await client.spaces.get("1DXxyRYNejbKM", {
    spaceFields: ["title", "host_ids", "state"],
    expansions: ["host_ids"],
    userFields: ["username", "verified"],
  });

  console.log(`Space: ${response.data?.title}`);
  // होस्ट जानकारी response.includes?.users में है
  ```
</CodeGroup>

<div id="response-with-expansion">
  ### विस्तार के साथ रिस्पॉन्स
</div>

```json theme={null}
{
  "data": {
    "id": "1DXxyRYNejbKM",
    "state": "live",
    "title": "Discussing AI and the Future",
    "host_ids": ["2244994945"]
  },
  "includes": {
    "users": [
      {
        "id": "2244994945",
        "username": "XDevelopers",
        "verified": true
      }
    ]
  }
}
```

***

<div id="space-states">
  ## Space की स्थितियाँ
</div>

| स्थिति      | विवरण                   |
| :---------- | :---------------------- |
| `live`      | वर्तमान में सक्रिय      |
| `scheduled` | भविष्य के लिए निर्धारित |
| `ended`     | समाप्त हो चुकी है       |

***

<div id="available-fields">
  ## उपलब्ध फ़ील्ड्स
</div>

| Field               | Description                    |
| :------------------ | :----------------------------- |
| `title`             | Space का शीर्षक                |
| `host_ids`          | होस्ट उपयोगकर्ता ID            |
| `speaker_ids`       | वक्ता उपयोगकर्ता ID            |
| `participant_count` | वर्तमान प्रतिभागियों की संख्या |
| `scheduled_start`   | निर्धारित प्रारंभ समय          |
| `started_at`        | वास्तविक प्रारंभ समय           |
| `ended_at`          | समाप्ति समय                    |
| `is_ticketed`       | क्या Space टिकट-आधारित है      |
| `state`             | वर्तमान स्थिति                 |

***

<div id="next-steps">
  ## अगले चरण
</div>

<CardGroup cols={2}>
  <Card title="Spaces खोजें" icon="magnifying-glass" href="/hi/x-api/spaces/search/quickstart">
    कीवर्ड के आधार पर Spaces खोजें
  </Card>

  <Card title="API संदर्भ" icon="code" href="/hi/x-api/spaces/space-lookup-by-space-id">
    एंडपॉइंट का पूरा दस्तावेज़ीकरण
  </Card>
</CardGroup>
