Batches
...
Batches API
Batches

Get Batch

4min
get batch you can get a batch by making making a http get request to the /batches/batch id endpoint (where batch id is the id of the batch you wish to get) serpwow will return all information about the batch, including whether it is currently running and how many searches and results sets the batch currently has note that the batch get endpoint just returns counts of the number of searches and result sets the batch contains if you wish to retrieve the actual searches or result sets in the batch you should use the list searches https //docs trajectdata com/serpwow/batches api/searches/list and list result sets https //docs trajectdata com/serpwow/batches api/results/list endpoints example get get /batches/batch id in the example below we get a batch with id=123456 http https //api serpwow\ com/live/batches/123456?api key=demo$ curl "https //api serpwow\ com/live/batches/123456?api key=demo"const axios = require('axios'); const params = { api key 'demo' } axios get('https //api serpwow\ com/live/batches/123456', { params }) then(response => { const apiresponse = response data; console log('batch name ' + apiresponse batch name); }) catch(error => { console log(error); });import requests params = { 'api key' 'demo' } api result = requests get('https //api serpwow\ com/live/batches/123456', params) api response = api result json() print "batch name ", api response\['batch']\['name']\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api serpwow\ com/live/batches/123456', $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 "batch name ", $api result\['batch']\['name'], php eol; ?> serpwow responds with the following json showing all details of the batch { "request info" { "success" true }, "batch" { "id" "123456", "created at" "2020 01 01t00 00 00 000z", "name" "my first batch", "schedule type" "manual/daily/weekly/monthly", "priority" "normal", "destination ids" \[ "destination id 1", "destination id 2" ], "enabled" true, "status" "idle/queued/running", "search total count" 0, "search page count" 0, "credits required" 0, "next result set id" 1, "results count" 0, "schedule hours" \[ 9, 17 ], "notification email" "john smith\@example com", "notification as json" false, "notification as jsonlines" false, "notification as csv" true } } next steps list searches https //docs trajectdata com/serpwow/batches api/searches/list list result sets https //docs trajectdata com/serpwow/batches api/results/list