You can export data (such as user records and your most recent discussions) to a CSV file from the API. In theory, doing so is as simple as adding .csv to the end of an API call but, in practice, it will require a bit of extra work to make it as useful as possible.
⭐️ EXAMPLE: Below is an example using the GET /users API call:
{
your_site_URL
}/api/v2/users.csv
By default, this will return one page of only 30 user records.
However, the GET /users API call can return up to 5,000 user records at a time, but you have to add the page
and limit
parameters, as shown:
{
your_site_URL
}/api/v2/users.csv?
page=1&limit=5000
📝 NOTE: The 5,000 record limit is only available when exporting to CSV. If you are making a standard API call, the limit is 500 users.
To get the next 5,000 user records, just increase the value of the page
parameter, specifying the next page number:
{
your_site_URL
}/api/v2/users.csv?
page=2
&limit=5000
✔️ TIP: Building on this example, if you have 50,000 users, you'll have to repeat this process up through page=10
to get all your user records.
Essentially, the default values, page=1 and limit=30, are assumed but can be increased and additional parameters can be used in order to export specific data as described below.
How to enable .CSV exports of data
❗️Please note that since Release 2023.017 this is apart of our core product. This permission isnot
enabled by default, so please take a few minutes to enable this permission for your admins and any other roles you want.
You will find this permission in the Garden section > Exports > Manage:
This improvement was added based on your feedback on the Success Community, so please make sure you keep those product ideas coming!
Read more about the permission here:
Other useful parameters
There are other parameters that make the GET /users API call even more useful.
Date focused
⭐️ EXAMPLE: Get a list of all new members who have joined on and after a specified date by including the dateInserted
parameter:
{
your_site_URL
}/api/v2/users.csv?
dateInserted=>=2022-10-03
&page=1&limit=5000
Specifying dates
You can export date-based data in several ways by specifying the dateInserted
parameter with some standard mathematical operators (=, >=, >, <=, <) , as in:
dateInserted
=
2022-10-03
means "on this date only"dateInserted=>2022-10-03
means "all days after (but not including) this date"dateInserted
=>=
2022-10-03
means "on this date and after"
User data
⭐️ EXAMPLE: Get all available user data and have it expand all the records in the CSV file by adding the expand
parameter:
{
your_site_URL
}/api/v2/users.csv?page=1&limit=5000&
expand=all
⭐️ EXAMPLE: You ca also use the expand
parameter to include the extended profile fields:
{
your_site_URL
}/api/v2/users.csv?page=1&limit=5000&
expand=extended
Additional resources
To learn about (and try out!) the options that are available with the /users endpoint and our other endpoints, check out the API v2 page in your Vanilla dashboard (Settings > API Integrations > API v2).
- To see a current list of all of Vanilla's API v2 endpoints, see: