Batches
...
Batches API
Batches

List Batches

5min
list batches you can list all of the batches currently set up on your account by making making a http get request to the /batches endpoint note that the batch list endpoint is rate limited to 60 requests per minute for real time updates as to your batch status it is recommended you use webhooks parameters the following querystring (http get) parameters allow you to refine the results returned by the batches list api parameter required description api key required the api key for your account only with results optional set to only with results=true to only return batches that have result sets available only without results optional set to only without results=true to only return batches that have no result sets available (i e that haven't yet been run) search term optional limits the returned batches to just those containing the search term in their name search type optional determines how the search term parameter is treated valid values are parameter values contains default returns batches that contains all of the words (split by spaces) in the search term in their name or id properties (case insensitive) non alphanumeric characters are replaced by spaces starts with returns batches whose name property starts with the search term (case insensitive) ends with returns batches whose name property ends with the search term (case insensitive) exact returns batches whose name property exactly matches the search term (case sensitive) status optional filters the batches returned to only those matching the given status valid values are all , idle , queued or running defaults to all created before optional filters the batches returned to only those with a created at date before the value specified should be specified as an iso utc timestamp https //docs trajectdata com/serpwow/batches api/batches/https //en wikipedia org/wiki/iso 8601 , for example created before=2020 09 01t00 00 00 000z created after optional filters the batches returned to only those with a created at date after the value specified should be specified as an iso utc timestamp https //docs trajectdata com/serpwow/batches api/batches/https //en wikipedia org/wiki/iso 8601 , for example created after=2020 06 01t00 00 00 000z last run before optional filters the batches returned to only those with a last run date before the value specified should be specified as an iso utc timestamp https //docs trajectdata com/serpwow/batches api/batches/https //en wikipedia org/wiki/iso 8601 , for example last run before=2020 09 01t00 00 00 000z last run after optional filters the batches returned to only those with a last run date after the value specified should be specified as an iso utc timestamp https //docs trajectdata com/serpwow/batches api/batches/https //en wikipedia org/wiki/iso 8601 , for example last run after=2020 06 01t00 00 00 000z destination id optional filters the batches returned to only those with the specified destination id set you can view destination ids on the destinations page of the dashboard or via the destinations api page optional set the page number of batches to return, defaults to page=1 unless otherwise specified using the page size parameter, 25 batches are returned per page page size optional sets the number of results returned per page if the page size parameter is omitted then 25 results are returned per page by default the maximum number of results returned per page is 1000 ( page size=1000 ) sort by optional the sort order to apply to the results valid values are created at (to sort by batch creation date), last run (to sort by the date the batch was last run), name (to sort by batch name, the default), priority (to sort by batch priority) or status (to sort by batch status) use in conjunction with the sort direction parameter sort direction optional the sort direction to return results valid values are descending or ascending (the default) use in conjunction with the sort by parameter example get get /batches in the example below we list all the batches on your account http https //api serpwow\ com/live/batches?api key=demo$ curl "https //api serpwow\ com/live/batches?api key=demo"const axios = require('axios'); const params = { api key 'demo' } axios get('https //api serpwow\ com/live/batches?api key=demo') then(response => { const apiresponse = response data; console log("total batches ", apiresponse total count); apiresponse collections map((batch, number) => console log((number + 1) + ' ' + batch name); }) catch(error => { console error(error); });import requests params = { 'api key' 'demo' } api result = requests get('https //api serpwow\ com/live/batches', { params }) api response = api result json() print "total batches ", api response\['total count'] for number, batch in enumerate(api response\['batches'], start=1) print "%s %s" % (number, batch\['name'])\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api serpwow\ com/live/batches', $querystring)); curl setopt($ch, curlopt returntransfer, true); curl setopt($ch, curlopt followlocation, true); \# the following options are required if you're using an outdated openssl version \# more details https //www openssl org/blog/blog/2021/09/13/letsencryptrootcertexpire/ curl setopt($ch, curlopt ssl verifyhost, false); curl setopt($ch, curlopt ssl verifypeer, false); curl setopt($ch, curlopt timeout, 180); $json = curl exec($ch); curl close($ch); $api result = json decode($json, true); print r($api result); echo "total batches ", $api result\['total count'], php eol; foreach ($api result\['batches'] as $number => $batch) { echo "{$number} {$batch\['name']}", php eol; } ?> serpwow responds with the following json showing all the batches on your serpwow account { "request info" { "success" true }, "total count" 2, "total pages" 1, "current page" 1, "count this page" 2, "batches" \[ { "id" "2a6f94bb", "created at" "2020 01 01t00 00 01 000z", "last run" "2020 09 01t00 00 00 000z", "name" "my second batch", "schedule type" "weekly", "priority" "normal", "destination ids" \[ "destination id 1", "destination id 2" ], "enabled" true, "status" "idle", "searches total count" 0, "searches page count" 0, "next result set id" 1, "results count" 0, "schedule days of week" \[ 0, 3 ], "schedule hours" \[ 8 ], "notification email" "john smith\@example com", "notification as json" false, "notification as jsonlines" false, "notification as csv" false }, { "id" "cac8651d", "created at" "2020 01 02t00 00 00 000z", "last run" "2020 09 01t00 10 00 000z", "name" "my first batch", "schedule type" "daily", "priority" "normal", "destination ids" \[], "enabled" true, "status" "idle", "searches total count" 0, "searches page count" 0, "results count" 0, "schedule hours" \[ 9, 17 ], "notification email" "john smith\@example com", "notification as json" false, "notification as csv" true } ] } next steps webhook https //docs trajectdata com/serpwow/batches api/batches/webhook list searches https //docs trajectdata com/serpwow/batches api/searches/list list result sets https //docs trajectdata com/serpwow/batches api/results/list