# Quickstart

Source: https://swapcard.dev/quickstart


Make your first request to the Content API: create an API key, list your events, then fetch one.

:::tip[Before you start]
You need access to an organization in [Swapcard Studio](https://studio.swapcard.com). Building for an exhibitor instead? Start with the [Leads API](/leads-api/about-the-api).
:::

## 1. Create an API key

In Studio, open your profile menu and go to **[API keys](https://studio.swapcard.com/api-keys)**, then select **Create a new key**.

The key acts on behalf of your user, with your roles and permissions. Keep it on your server and never ship it in a web page or mobile app. See [Authentication](/organizer/authentication) for details.

## 2. List your events

Every request is a `POST` to a single GraphQL endpoint. Send your key as-is in the `Authorization` header.

**cURL**

```bash
curl https://developer.swapcard.com/event-admin/graphql \
  -H 'Authorization: <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{"query": "{ events(pageSize: 10) { id title beginsAt } }"}'
```

**Node.js**

```javascript
const response = await fetch("https://developer.swapcard.com/event-admin/graphql", {
  method: "POST",
  headers: {
    Authorization: process.env.SWAPCARD_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "{ events(pageSize: 10) { id title beginsAt } }",
  }),
});

const { data, errors } = await response.json();
console.log(errors ?? data.events);
```

**Python**

```python

response = requests.post(
    "https://developer.swapcard.com/event-admin/graphql",
    headers={"Authorization": os.environ["SWAPCARD_API_KEY"]},
    json={"query": "{ events(pageSize: 10) { id title beginsAt } }"},
)

print(response.json())
```

Copy the `id` of the event you want to work with.

## 3. Fetch one event

Pass the ID as a variable. GraphQL returns exactly the fields you ask for.

```graphql
query EventById($eventId: ID!) {
  event(id: $eventId) {
    title
    beginsAt
    endsAt
    timezone
    totalExhibitors
    totalSpeakers
  }
}
```

```json title="Variables"
{ "eventId": "<EVENT_ID>" }
```

:::info[Prefer clicking to typing?]
The [API Explorer](/content-api/discover-explorer) runs the same queries in your browser, with autocomplete for every field.
:::

## Next steps

- **Read and write event content:** [people](/content-api/examples/people), [sessions](/content-api/examples/sessions), [exhibitors](/content-api/examples/exhibitors) and more in the [Content API](/content-api/about-the-graphql-api) guides.
- **React to changes instead of polling:** subscribe to [webhooks](/webhooks/about-webhooks).
- **Export engagement data:** use the [Analytics API](/analytics-api/about-the-graphql-api).
- **Stay within limits:** check the [rate limits](/content-api/limitations) before running bulk jobs.
