Batches
...
Batches API
Result Sets
List Result Sets
3min
list result sets you can list all of the result sets for a batch by making a http get request to the /batches/batch id/results endpoint (where batch id is the id of the batch to get result sets for) value serp retains result sets for 14 days so you should download your result set data within this 14 day window example get get /batches/batch id/results in the example below we list all of the result sets for the batch with id=123456 http https //api valueserp com/batches/123456/results?api key=demo$ curl "https //api valueserp com/batches/123456/results?api key=demo"const axios = require('axios'); const params = { api key 'demo' } axios get('https //api valueserp com/batches/123456/results', { params }) then(response => { const apiresponse = response data; }) catch(error => { console log(error); });import requests params = { 'api key' 'demo' } api result = requests get('https //api valueserp com/batches/123456/results', params) api response = api result json()\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api valueserp com/batches/123456/results', $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); ?> value serp responds with the following json showing all the results sets for the batch note the results array contains a list of all of the result sets the id property of a result set should be used with the get result set https //docs trajectdata com/valueserp/batches api/results/get endpoint to retrieve the actual results within the result set note the results array is sorted by the most recently run result set first { "request info" { "success" true }, "batch id" "123456", "batch" { "id" "123456", "created at" "2019 01 01t00 00 00 000z", "name" "my first batch", "schedule type" "daily", "enabled" true, "status" "idle", "searches total count" 1, "searches page count" 1, "results count" 1, "schedule hours" \[ 9, 17 ], "notification email" "john smith\@example com", "notification as json" false, "notification as jsonlines" false, "notification as csv" true }, "results count" 1, "results" \[ { "id" 1, "started at" "2019 01 02t00 00 00 000z", "ended at" "2019 01 02t00 00 10 000z", "expires at" "2019 01 08t00 00 10 000z", "results page count" 1, "searches completed" 1, "searches failed" 0, "searches total" 1, "webhook status" { "status" "ok", "log" \[ { "date time" "2020 01 01t00 00 00 000z", "text" "webhook post completed successfully " } ] }, "destination status" { "destination id" { "status" "ok", "log" \[ { "date time" "2020 01 01t00 00 00 000z", "text" "destination upload completed successfully " } ] } } } ] }