Skip to main content

About the Analytics API

The Analytics API allows you to download the raw analytics data.

Overview

Here are some quick links to get you up and running with the Analytics API:

Root endpoint

The Analytics API has a single endpoint.

https://developer.swapcard.com/event-admin/export/analytics

The endpoint remains constant no matter what operation you perform.

About the API

The export API consists of only one HTTP POST endpoint.

The response is a stream of new line separated json, ordered from the least to the most recent.

Each json represent an action from an user that happened on the platform.

Request

Each json contains a cursor field that should be used to retrieve all subsequent actions for a consecutive HTTP request.

curl -X POST 'https://developer.swapcard.com/event-admin/export/analytics' \
-H 'Content-Type: application/json' \
-H 'Authorization: <TOKEN>' \
-d '{
"event_ids": [List of event ids],
"time_gt": "Time interval" # ex: 2022-09-01T00:00:00.000Z,
"time_lt": "Time interval" # ex: 2022-10-01T00:00:00.000Z
}'

Response

A successful HTTP request response is a stream of new line separated json. Bear in mind that the stream is potentially infinite if no limit is provided.

{"cursor":"eyJFeGVtcGxlQ3Vyc29yIjogMX0=","time":"2020-09-04T15:00:17.737Z","event":"people_view_search","platform":"web-user","event_id":"RXZlbnRfMA==","properties":{"query":"market","event_view_id":"RXZlbnRWaWV3XzA="},"user_id":"VXNlcl8w","group_ids":["RXZlbnRHcm91cF8w"]}
{"cursor":"eyJFeGVtcGxlQ3Vyc29yIjogMn0=","time":"2020-09-04T15:00:17.961Z","event":"exhibitor_show","platform":"android","event_id":"RXZlbnRfMA==","properties":{},"user_id":"VXNlcl8x","group_ids":["RXZlbnRHcm91cF8w","RXZlbnRHcm91cF8x"],"exhibitor_ids":["RXhoaWJpdG9yXzA="],"with_exhibitor_ids":["RXhoaWJpdG9yXzE="]}
{"cursor":"eyJFeGVtcGxlQ3Vyc29yIjogM30=","time":"2020-09-04T15:00:18.020Z","event":"document_open","platform":"android","event_id":"RXZlbnRfMA==","properties":{"document_id":"RG9jdW1lbnRfMA=="},"user_id":"VXNlcl8x","group_ids":["RXZlbnRHcm91cF8w","RXZlbnRHcm91cF8x"],"exhibitor_ids":["RXhoaWJpdG9yXzA="]}
{"cursor":"eyJFeGVtcGxlQ3Vyc29yIjogNH0=","time":"2020-09-04T15:00:18.172Z","event":"planning_stream_start","platform":"web-user","event_id":"RXZlbnRfMA==","properties":{"planning_id":"UGxhbm5pbmdfMA=="},"user_id":"VXNlcl8w","group_ids":["RXZlbnRHcm91cF8w","RXZlbnRHcm91cF8x","RXZlbnRHcm91cF8y"]}