Skip to Content

Flows

GET /v1/flows returns directed origin-to-destination flow rows for a region filter. Use it for questions like “where are Williamson County’s in-migrants coming from?” or “where are residents leaving Davidson County going?”

When period is omitted, the API uses the latest period_start available for the supplied filters and reports that date in meta.period.

Request

curl "https://api.creativeforesight.io/v1/flows?destination=47187&measure=agi&limit=3" \ -H "Authorization: Bearer $CF_API_KEY"

Query parameters

ParameterTypeRequiredDescription
originstringNoOrigin region code. At least one of origin or destination is required.
destinationstringNoDestination region code. At least one of origin or destination is required.
measurestringNoFlow measure, such as agi, returns, or individuals.
periodstringNoperiod_start date in YYYY-MM-DD format. Defaults to the latest available period for the filters.
limitintegerNoMaximum rows to return. Defaults to 50 and caps at 500.

Response

{ "data": [ { "origin": { "code": "47037", "name": "Davidson County" }, "destination": { "code": "47187", "name": "Williamson County" }, "measure": "agi", "period_start": "2022-01-01", "value": 250000 } ], "meta": { "count": 1, "limit": 3, "period": "2022-01-01", "filters": { "destination": "47187", "measure": "agi" }, "units": { "agi": "USD, thousands", "returns": "count", "individuals": "count" } } }

value is reported exactly as published by the source. For IRS migration flow measures, agi values are thousands of USD; returns and individuals are counts.

Errors

StatusCodeMeaning
400INVALID_PARAMETERRequired or optional query parameters are invalid, including missing both origin and destination.
401INVALID_API_KEYThe request did not include a valid API key and was not a settled x402 request.
404RESOURCE_NOT_FOUNDThe requested origin or destination region was not found.
429RATE_LIMIT_EXCEEDEDThe API key exceeded its one-minute request limit.
500INTERNAL_ERRORFlow data could not be loaded.
Last updated on