data/properties
Search and download property data using the Datafiniti API v3.
curl -X GET "https://api.datafiniti.co/v3/data/properties?q=categories:hotels AND country:US&records=10&format=JSON&download=false&view=businesses_all" \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_CREDENTIALS"
import requests
import json
url = "https://api.datafiniti.co/v3/data/properties?q=categories:hotels AND country:US&records=10&format=JSON&download=false&view=businesses_all"
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/data/properties?q=categories:hotels AND country:US&records=10&format=JSON&download=false&view=businesses_all", {
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/data/properties?q=categories:hotels AND country:US&records=10&format=JSON&download=false&view=businesses_all", 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/data/properties?q=categories:hotels AND country:US&records=10&format=JSON&download=false&view=businesses_all')
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
{
"num_found": 95378,
"total_cost": 1,
"records": [
{}
]
}
[
{
"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": "field_name does not exist in property schema"
}
{
"error": "invalid query"
}
{
"error": "view does not exist"
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
/data/properties
Username for basic authentication
Password for basic authentication
Search query using Datafiniti query syntax. Supports boolean operators (AND, OR), exact match with quotes, wildcards (*), negation (-), range queries, and nested field queries. Example: categories:hotels AND country:US
Number of records to return. For preview (download=false): 0-10, defaults to 10. For download (download=true): 1 to total matching records. If omitted during download, all matching records will be downloaded.
Output format for the data. JSON returns data as JSON objects. CSV returns data in CSV format.
Set to true to initiate a bulk download. When false (default), returns up to 10 preview records immediately. When true, returns a 303 redirect to the /requests endpoint to monitor download progress.
The view determines which fields are returned in the response and the order they appear. Different views are available for each data type. Examples for businesses: businesses_all, businesses_all_nested. Examples for products: products_all, products_basicFields, products_pricesFlat. Examples for properties: properties_all, properties_all_nested.
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.
Query Parameters
Search query using Datafiniti query syntax. Supports boolean operators (AND, OR), exact match with quotes, wildcards (*), negation (-), range queries, and nested field queries. Example: categories:hotels AND country:US
Number of records to return. For preview (download=false): 0-10, defaults to 10. For download (download=true): 1 to total matching records. If omitted during download, all matching records will be downloaded.
Output format for the data. JSON returns data as JSON objects. CSV returns data in CSV format.
JSONCSVSet to true to initiate a bulk download. When false (default), returns up to 10 preview records immediately. When true, returns a 303 redirect to the /requests endpoint to monitor download progress.
The view determines which fields are returned in the response and the order they appear. Different views are available for each data type. Examples for businesses: businesses_all, businesses_all_nested. Examples for products: products_all, products_basicFields, products_pricesFlat. Examples for properties: properties_all, properties_all_nested.
Responses
Total number of records in Datafiniti matching the query
Number of credits consumed by this request
Array of matching records. The fields present depend on the data type and view used.
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.
Redirect to the /requests endpoint to monitor download status (when download=true)
Error message describing what went wrong
Error message describing what went wrong
The data endpoint lets you run preview searches and initiate downloads for property data.
If you set download=false (or don't set it), the API call will return a list of matching properties for your query. If you don't set records when download=false, it will return up to 10 properties. You can set records to a value between 0 and 10.
If you set download=true, it will return a request object that can be used to monitor the status of the download request. If you don't set records when download=true, it will initiate a download request for all matching records. You can set records to a value between 1 and the number of matching records.
Last updated 1 week ago
Built with Documentation.AI