Quickstart
Make your first request to the Content API: create an API key, list your events, then fetch one.
You need access to an organization in Swapcard Studio. Building for an exhibitor instead? Start with the Leads API.
1. Create an API key
In Studio, open your profile menu and go to 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 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
- Node.js
- Python
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 } }"}'
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);
import os
import requests
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.
query EventById($eventId: ID!) {
event(id: $eventId) {
title
beginsAt
endsAt
timezone
totalExhibitors
totalSpeakers
}
}
{ "eventId": "<EVENT_ID>" }
The API Explorer runs the same queries in your browser, with autocomplete for every field.
Next steps
- Read and write event content: people, sessions, exhibitors and more in the Content API guides.
- React to changes instead of polling: subscribe to webhooks.
- Export engagement data: use the Analytics API.
- Stay within limits: check the rate limits before running bulk jobs.