Entries API
ShortStack offers an Entries API that enables you to retrieve entry data collected and stored in your account. ShortStack's API is intended for use by software developers and is an advanced feature. If you are unsure, please feel free to use one of the Form Integration options detailed below.
Before you start
Every request needs the header
Authorization: Token token=YOUR_API_KEY. If you donβt yet have an API key, you can create one using the API Explorer (see next section).Successful calls return JSON that looks like
{ "data": [...] }. Errors come back with a short text message and a status code such as401(bad key) or404(item not found).
API explorer
You can use the Entries Manager to filter entries based on your chosen criteria, then use our Entry API Explorer to build a curl command to retrieve the same entries via our API.
From the navigation bar, choose Manage > Entries.
(Optional) Sort and filter by the list you wish to export.
Click the Actions dropdown at the top right of the Entries Manager.
Select Explore Entries API.
Follow the API Explorer instructions to select an existing API key (if any) or to create a new one.
The generated
curlcommand will reflect any filters applied in the Entries Manager.
Basic list request
Fetch the first 25 entries you can see:
curl -i -H "Authorization: Token token=$API_KEY" \
"https://entries.shortstack.com/entries?per_page=25"Sample response:
{
"data": [
{
"id": 12345,
"campaign_id": 678,
"list_id": 91011
}
]
}Paging through results
Run your request with
-iso headers are shown:curl -i -H "Authorization: Token token=$API_KEY" \ "https://entries.shortstack.com/entries?sort=received&direction=descending&per_page=50"Look in the output for a header named
Link:. Copy the web address inside<>that ends withrel="next".Call that address to load the next page:
curl -i -H "Authorization: Token token=$API_KEY" \ "https://entries.shortstack.com/entries?sort=received&direction=descending&per_page=50&last_id=45678&last_sort=2024-04-10T16:45:00Z"Repeat until the header no longer shows
rel="next".To jump back to the beginning with the same filters, copy the address that ends with
rel="first"and call it:curl -i -H "Authorization: Token token=$API_KEY" \ "https://entries.shortstack.com/entries?sort=received&direction=descending&per_page=50"
Paging & sorting parameters
per_pageβ how many entries to return (default 100, max 5000).sortβ the field to order results by (defaults toid).directionβascendingordescendingorder.last_idβ the finalidfrom the previous page when you follow anextlink.last_sortβ the last value of yoursortfield when sorting by something other thanid.
Filtering parameters
campaignβ one or more campaign IDs, passed ascampaign=1,2.listβ one or more list IDs.feedβ one or more social media feed IDs.list_tagβ one or more tag names that map to list IDs.categoryβ one or more category names.cityβ one or more city names.countryβ one or more country codes or names.provinceβ one or more state or province names.postal_codeβ one or more postal or ZIP codes (dashes are ignored).labelβ one or more label values.emailβ exact email address to match.receivedβ date range in the formstart,end(ISO8601).ageβ age range in the formmin,max.idβ ID range in the formmin,max.votes1,votes2,votes3β vote count ranges in the formmin,max.image_width,image_heightβ image dimension ranges in the formmin,max.recaptcha_scoreβ decimal score range in the formmin,max.approvedβtrue,false,1, or0to filter by approval status.exclude_feedsβ set totrue/1to include only entries without a feed unlessfeedis also sent.imageβtrue/falseto require an image.testβtrue/falseto find test entries.videoβtrue/falseto require a video.profileβ export profile ID that controls which fields appear.es_boolean_Xβ filters on a custom boolean field defined in your profile (Xis the number shown in the profile).es_date_Xβ filters on a custom date range for profile fieldX.es_number_Xβ filters on a custom numeric range for profile fieldX.es_list_Xβ filters on a custom list field for profile fieldX; pass multiple values as a list.
Filter examples by parameter type
Text match: add
country=USto find entries from the United States.Boolean switch: add
approved=trueto find only approved entries (true,false,1, or0are accepted).List of IDs: add
list=12,34to pull entries from those two lists.Date range: add
received=2024-01-01,2024-01-31for entries received in January 2024 (leave a side blank for open-ended ranges, e.g.,received=,2024-01-31).Number range: add
age=18,to find ages 18 and higher, orvotes1=10,20for a specific span.Search term: add
search=winnerto look across indexed text fields; emails likename@example.comare matched exactly.Profile output: add
profile=42if you have an export profile that maps fields for download.Custom profile field: add
es_list_2=VIP,Priorityto filter on a mapped list-type custom field.
Combine filters by joining them with &, for example:
curl -i -H "Authorization: Token token=$API_KEY" \
"https://entries.shortstack.com/entries?per_page=50&country=US&approved=true&received=2024-01-01,2024-03-31"Get a single entry
Provide the entry ID, and optionally a profile to shape the response:
curl -i -H "Authorization: Token token=$API_KEY" \
"https://entries.shortstack.com/entries/12345?profile=42"If the entry belongs to another account or does not exist you will receive a 404 response.
Other options for form integrations
ShortStack also supports form integrations to enhance your campaign functionality. These include:
MailChimp
Google Maps
Webhooks
Learn more about Form Integrations.
Related resources
Was this helpful?
Thanks β that helps us decide what to fix next.
Sorry this missed. Tell us what you needed and we'll get you an answer β and fix the page.