Skip to main content

Custom Locations

This is an enterprise service. Send an inquiry to Unacast about your interest.

Obtain foot traffic for custom locations on demand. This API allows you to submit requests for foot traffic reports on your custom polygons.

These APIs are currently only available over gRPC. Below in the examples you will find the currently supported language clients. Other language clients can be provided on request.

Constraints

  • US locations are supported
  • Up to 500 locations can be provided per report

Metric Models

 metric_idmore info
foot_traffic_week_202401Foot Traffic w/Visit Length
foot_traffic_month_202401Foot Traffic w/Visit Length
popular_times_202408Popular Times
trade_areas_quarterly_202401Trade Area
trade_areas_zip_quarterlyTrade Area
demographics_quarterly_202401Visitor Demographics
spatialai_personalive_quarterly_202401Premium option. Visitor Phychographics with SpatialAI PersonAlive segments.

Examples

Python

pre-requisites

  • install the python-language client: pip install unacatlib
import datetime
from unacatlib.byo_external import BYOApiClient, ReportJob

# Sample geo json, currently accepting only geojson of **FeatureCollection** of **Polygon** types.
poi_geo_json='{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name": "my-given-location-name"},"geometry":{ "type": "Polygon", "coordinates": [ [ [-122.276737859, 37.8439032810001], [-122.276899008, 37.8438818770001], [-122.276870739, 37.84375312], [-122.276741817, 37.8437702410001], [-122.276711462, 37.8437830560001], [-122.276737859, 37.8439032810001] ] ] }}]}'

def run():

with BYOApiClient(
billing_account="<ID you'll be provided>",
token="<Token you'll be provided>",
) as client:
job: ReportJob = client.create_us_report(
pois=poi_geo_json,
metric_ids=["foot_traffic_week_202401"],
start_date=datetime.date(year=2024, month=3, day=1),
end_date=datetime.date(year=2024, month=4, day=30)
)

job.wait_for_completion()

# Some status checks here, i.e if success read metric report or do something else on error.
if not job.is_success:
print("Job failed")
else:
for metric_id in job.metric_ids:
metric_values = client.read_us_report(report_id=job.id, metric_id=metric_id)
print({"schema": metric_values.schema.to_json(), "values": list(map(lambda mv: mv.to_json(), metric_values.values))})

run()