List available datasets
curl --request GET \
--url https://api.globalwebindex.com/v1/spark-api/datasets \
--header 'Authorization: <api-key>'import requests
url = "https://api.globalwebindex.com/v1/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/v1/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/v1/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/v1/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/v1/spark-api/datasets")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v1/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[
{
"code": "ds-example",
"name": "GWI Example",
"type": "dataset",
"description": "An example dataset.",
"url": "https://help.globalwebindex.com/example/dataset/ref",
"children": [
{
"id": 1,
"name": "GWI Folder",
"type": "folder",
"children": [
{
"code": "ds-example-child",
"name": "GWI Example Child",
"description": "An example child dataset.",
"url": "https://help.globalwebindex.com/example/dataset/child/ref",
"type": "dataset",
"children": []
}
]
}
]
}
]{
"message": "Unauthorized"
}{
"code": 500,
"message": "There was an error processing your request. Please try again later."
}Datasets
List available datasets
Returns the datasets available for chat and insights. The route returns a hierarchical tree of folder and dataset nodes so clients can discover valid root/child dataset relationships.
GET
/
v1
/
spark-api
/
datasets
List available datasets
curl --request GET \
--url https://api.globalwebindex.com/v1/spark-api/datasets \
--header 'Authorization: <api-key>'import requests
url = "https://api.globalwebindex.com/v1/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/v1/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/v1/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/v1/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/v1/spark-api/datasets")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalwebindex.com/v1/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[
{
"code": "ds-example",
"name": "GWI Example",
"type": "dataset",
"description": "An example dataset.",
"url": "https://help.globalwebindex.com/example/dataset/ref",
"children": [
{
"id": 1,
"name": "GWI Folder",
"type": "folder",
"children": [
{
"code": "ds-example-child",
"name": "GWI Example Child",
"description": "An example child dataset.",
"url": "https://help.globalwebindex.com/example/dataset/child/ref",
"type": "dataset",
"children": []
}
]
}
]
}
]{
"message": "Unauthorized"
}{
"code": 500,
"message": "There was an error processing your request. Please try again later."
}Authorizations
Response
Successful response.
The response is an array of hierarchical tree nodes.
- Folder
- Dataset
A folder or dataset node returned by /v1/spark-api/datasets. Use the type field to determine which variant a node is.
Was this page helpful?
⌘I

