# Events

Source: https://swapcard.dev/content-api/examples/event


Fetch the details of one or more events, such as dates, address, banner, totals and groups. An event is linked to a community and owned by an organization.

Reference: [`Event` object](../graphql-event-api-schema/objects/event.mdx)

## Before you begin

- An API key, sent in the `Authorization` header. The key acts with the roles and permissions of the user who created it. See [Authentication](/organizer/authentication).
- The ID of each event you want to fetch. To list your events and their IDs, follow the [Quickstart](/quickstart).

## Fetch an event
Use this query to fetch all the information about a single event.

| Argument | Type | Description |
| --- | --- | --- |
| [`eventId`](../graphql-event-api-schema/queries/event.mdx#id-id) | `ID!` | The ID of the event. |

```graphql title="Query"
query EventById($eventId: ID!) {
  event(id: $eventId) {
    id
    slug
    title
    beginsAt
    endsAt
    createdAt
    htmlDescription
    banner {
      imageUrl
      embeddedVideo {
        ... on YoutubeEmbeddedVideo {
          videoId
        }
      }
    }
    address {
      place
      street
      city
      zipCode
      state
      country
    }
    isLive
    updatedAt
    language
    timezone
    totalPlannings
    totalExhibitors
    totalSpeakers
    groups {
      id
      name
      peopleCount
    }
  }
}
```

```json title="Variables"
{
  "eventId": "RXZlbnDY1Nc4"
}
```

## Fetch multiple events
Use this query to fetch the basic information about several events in one call.

| Argument | Type | Description |
| --- | --- | --- |
| [`eventIds`](../graphql-event-api-schema/queries/events.mdx#filters-eventfilterinput) | `[String!]` | A list of event IDs. |

:::note
The `ids` argument of `events` is deprecated in favor of `filters.ids`. See the [`events` query reference](../graphql-event-api-schema/queries/events.mdx).
:::

```graphql title="Query"
query events($eventIds: [String!]) {
  events(ids: $eventIds) {
    id
    slug
    title
    beginsAt
    endsAt
    createdAt
    htmlDescription
    banner {
      imageUrl
      embeddedVideo
    }
    address {
      place
      street
      city
      zipCode
      state
      country
    }
    isLive
    updatedAt
  }
}
```

```json title="Variables"
{
  "eventIds": [
    "RXZlbnDY1Nc4",
    "RXZlbnTUxMI0"
  ]
}
```
