Datasets API endpoint
Returns distribution counts over the stored BBB Scam Tracker reports (dataset id enum value `bbb-scamtracker-reports`), honoring the same filters as search. Counts are of stored reports. Facet enum: `scam_type`, `state`, `country`. country enum: `USA`, `CAN`.
/datasets/bbb-scamtracker-reports/facetsQuery parameters:
facet: required facet to aggregate. Allowed values: scam_type, state, country.q: optional full-text match on the report narrative and the business name used, max 256 characters.scam_type: optional exact scam type filter.state: optional 2-letter state or province code of the targeted person.country: optional country of the targeted person. Allowed values: USA, CAN.date_from: optional inclusive report-date floor, YYYY-MM-DD.date_to: optional inclusive report-date ceiling, YYYY-MM-DD.min_loss: optional floor against the reported dollar loss, 0 or greater.max_loss: optional ceiling against the reported dollar loss, 0 or greater.Response behavior:
facet=scam_type returns the scam type values to use as the scam_type search/facet filter, with counts.facet=state and facet=country count reports by the targeted person's state or province and country. Reports whose location names neither are not counted.date_from/date_to range to size that range before paging through search.items array (not an error) when nothing matches.Example response (counts are illustrative):
{
"code": 200,
"msg": "OK",
"data": {
"dataset": "bbb-scamtracker-reports",
"facet": "scam_type",
"items": [
{ "value": "Online Purchase", "count": 41250 },
{ "value": "Phishing", "count": 18733 }
]
}
}
| Field | Filled in, of 38 checked | Values in the sample |
|---|---|---|
| value | 38 | |
| count | 38 | 1 to 84,484, median 1,932 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| facet | string | Yes | Facet enum: scam_type, state, country Allowed values: scam_type, state, country. | scam_type | |
| q | string | No | Full-text match on the report narrative and the business name used, max 256 characters | ||
| scam_type | string | No | Exact scam type filter | ||
| state | string | No | 2-letter state or province code of the targeted person | ||
| country | string | No | Country of the targeted person. Enum: USA, CAN Allowed values: USA, CAN. | ||
| date_from | string | No | Inclusive report-date floor, YYYY-MM-DD | ||
| date_to | string | No | Inclusive report-date ceiling, YYYY-MM-DD | ||
| min_loss | number | No | Floor against the reported dollar loss, 0 or greater | ||
| max_loss | number | No | Ceiling against the reported dollar loss, 0 or greater | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/datasets/bbb-scamtracker-reports/facets?facet=scam_type&q=coffee&country=us" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"dataset": "bbb-scamtracker-reports",
"facet": "scam_type",
"items": [
{
"value": "Online Purchase",
"count": 41250
},
{
"value": "Phishing",
"count": 18733
}
]
}
}Request schema
No body schema
Response schema
#/definitions/datasets.scamTrackerReportsFacetResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | datasets.ScamTrackerReportsFacetResponse | No | ||||
| data.dataset | string | No | ||||
| data.facet | string | No | ||||
| data.items | array | No | ||||
| data.items[].count | integer | No | ||||
| data.items[].value | string | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 500 | Internal Server Error | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/datasets/bbb-scamtracker-reports/facets?facet=scam_type&q=coffee&country=us" \
-H "x-api-key: $CRAWLORA_API_KEY"