List datasets
curl --request GET \
--url https://api.globalwebindex.com/v2/spark-api/datasets \
--header 'Authorization: <api-key>'import requests
url = "https://api.globalwebindex.com/v2/spark-api/datasets"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.globalwebindex.com/v2/spark-api/datasets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.globalwebindex.com/v2/spark-api/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.globalwebindex.com/v2/spark-api/datasets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.globalwebindex.com/v2/spark-api/datasets")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v2/spark-api/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"datasets": [
{
"code": "ds-core",
"description": "Our primary data set on the attitudes and behaviors of digital consumers",
"name": "GWI Core",
"type": "dataset",
"is_simulated": false,
"children": [
{
"id": 446,
"name": "GWI Syndicated",
"type": "folder",
"is_simulated": false,
"children": [
{
"code": "ds-boost",
"description": "Our complimentary data set covering additional product categories and brands in a selection of Core markets",
"name": "GWI Core Plus",
"type": "dataset",
"is_simulated": false
},
{
"code": "ds-gwi-alcohol",
"description": "Our data set focused on consumption and purchase behaviors of alcohol consumers.",
"name": "GWI Alcohol",
"type": "dataset",
"is_simulated": false
}
]
}
]
},
{
"code": "ds-usa",
"description": "A 360-degree view of today's America",
"name": "GWI USA",
"type": "dataset",
"is_simulated": false
}
]
}{
"message": "Unauthorized"
}{
"type": "https://api.globalwebindex.com/docs/spark-api/problems/internal",
"title": "Internal server error",
"status": 500,
"detail": "There was an error processing your request. Please try again later.",
"instance": "/v2/spark-api/insights/generate"
}{
"type": "https://api.globalwebindex.com/docs/spark-api/problems/timeout",
"title": "Request timeout",
"status": 504,
"detail": "service is taking longer than usual to respond: please try again in a few moments",
"instance": "/v2/spark-api/insights/generate"
}Datasets
List datasets
Returns the datasets available to your account, as a tree of folders and datasets. The list is empty if your account has no dataset access.
GET
/
v2
/
spark-api
/
datasets
List datasets
curl --request GET \
--url https://api.globalwebindex.com/v2/spark-api/datasets \
--header 'Authorization: <api-key>'import requests
url = "https://api.globalwebindex.com/v2/spark-api/datasets"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.globalwebindex.com/v2/spark-api/datasets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.globalwebindex.com/v2/spark-api/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.globalwebindex.com/v2/spark-api/datasets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.globalwebindex.com/v2/spark-api/datasets")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v2/spark-api/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"datasets": [
{
"code": "ds-core",
"description": "Our primary data set on the attitudes and behaviors of digital consumers",
"name": "GWI Core",
"type": "dataset",
"is_simulated": false,
"children": [
{
"id": 446,
"name": "GWI Syndicated",
"type": "folder",
"is_simulated": false,
"children": [
{
"code": "ds-boost",
"description": "Our complimentary data set covering additional product categories and brands in a selection of Core markets",
"name": "GWI Core Plus",
"type": "dataset",
"is_simulated": false
},
{
"code": "ds-gwi-alcohol",
"description": "Our data set focused on consumption and purchase behaviors of alcohol consumers.",
"name": "GWI Alcohol",
"type": "dataset",
"is_simulated": false
}
]
}
]
},
{
"code": "ds-usa",
"description": "A 360-degree view of today's America",
"name": "GWI USA",
"type": "dataset",
"is_simulated": false
}
]
}{
"message": "Unauthorized"
}{
"type": "https://api.globalwebindex.com/docs/spark-api/problems/internal",
"title": "Internal server error",
"status": 500,
"detail": "There was an error processing your request. Please try again later.",
"instance": "/v2/spark-api/insights/generate"
}{
"type": "https://api.globalwebindex.com/docs/spark-api/problems/timeout",
"title": "Request timeout",
"status": 504,
"detail": "service is taking longer than usual to respond: please try again in a few moments",
"instance": "/v2/spark-api/insights/generate"
}Was this page helpful?

