Endpoints
As of v1.1
, these are the endpoints that have been fully implemented in bavapi
:
audiences
audience-groups
brand-metrics
brand-metric-groups
brands
brandscape-data
categories
cities
collections
companies
countries
regions
sectors
studies
years
"Implemented" meaning that the endpoint has a corresponding function, Client
method, and filters class associated
with them. More info in each endpoint's respective section linked above.
If an existing endpoint does not appear in the list above, you can still perform queries to them using the raw_query
methods (see below), but bavapi
won't validate filter parameters.
Examples for each endpoint are available in each of their individual sections, both for the top-level, synchronous
functions, and the asynchronous methods in bavapi.Client
.
For a summary of all existing Fount endpoints, as well as their parameters and supported filters, please see the Resources section of the Fount API documentation.
Other endpoints
While there are some commonly used endpoints with more extensive validation support, there are a lot of additional endpoints available for querying.
With the raw_query
functions and methods, you can perform requests to any endpoint in the Fount, even if it's not
supported with dedicated code.
Endpoint | Function | Client method | Filters class |
---|---|---|---|
{any} | raw_query | Client.raw_query | FountFilters |
Queries from raw_query
functions and methods return a list of JSON dictionaries, instead of a pandas
DataFrame.
You need to use a Query
instance to perform queries with raw_query
methods.
More info
Usage
- Sync
- Async
import bavapi
result = bavapi.raw_query("TOKEN", "companies", bavapi.Query())
import bavapi
async with bavapi.Client("TOKEN") as bav:
result = await bav.raw_query("companies", bavapi.Query())
Since the result of these queries will be a list of JSON dictionaries, you can use the parse_response
function in the
bavapi.parsing.responses
module to parse the JSON response into a DataFrame:
import bavapi
from bavapi.parsing.responses import parse_response
result = bavapi.raw_query("companies", bavapi.Query())
parsed = parse_response(result) # will return a DataFrame