requests
Monitor the status of your download requests.
curl -X GET "https://api.datafiniti.co/v3/requests" \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_CREDENTIALS"
import requests
import json
url = "https://api.datafiniti.co/v3/requests"
headers = {
"Content-Type": "application/json",
"Authorization": "Basic YOUR_CREDENTIALS"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://api.datafiniti.co/v3/requests", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Basic YOUR_CREDENTIALS"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.datafiniti.co/v3/requests", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Basic YOUR_CREDENTIALS")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.datafiniti.co/v3/requests')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Basic YOUR_CREDENTIALS'
response = http.request(request)
puts response.body
[
{
"id": 6073,
"records": "example_string",
"query": "categories:hotels AND country:US",
"dataType": "businesses",
"dataFormat": "csv",
"accountId": "AAAXXXXXXXXXXXX",
"planId": "free",
"view": "businesses_all_nested",
"async": 1,
"status": "STARTED",
"error": "",
"numDownloaded": 0,
"numFound": 95378,
"numRequested": 95378,
"date_started": "2017-1-11 15:52:42",
"date_completed": "2017-1-11 15:52:43"
}
]
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
/requests
Username for basic authentication
Password for basic authentication
Request Preview
Response
Response will appear here after sending the request
Authentication
Basic authentication credentials. V3 uses Basic Authentication with your API token as the username and no password. In URL form: https://YOUR_API_TOKEN:@api.datafiniti.co/v3/... In cURL: --user YOUR_API_TOKEN: (note the trailing colon). Get your token from the Datafiniti Web Portal at https://portal.datafiniti.co.
Responses
Unique identifier for the download request
Records field (may be empty)
The query that was used for this download
The data type being downloaded
businessesproductspropertiesThe format of the download files
jsoncsvYour API token used for this request
The Datafiniti plan level you're using
The view used for this download, determining which fields are included
Should always be 1. Indicates this is a download (async) request.
The current progress of the request. STARTED while running, COMPLETED when finished.
STARTEDCOMPLETEDAn error message if anything went wrong with the download. Empty string if no errors.
Number of records that have been downloaded so far. Increases as the download progresses.
Total number of records in Datafiniti that matched your query
Number of records you requested to download. If you didn't set records, this equals numFound.
Date and time the download started
Date and time the download completed. May match date_started if still in progress.
Error message describing what went wrong
The requests endpoint lets you monitor the status of all download requests you have initiated. Returns an array of request objects with status, progress, and metadata about each download.
Last updated 1 week ago
Built with Documentation.AI