Skip to main content

Faceting API

The article index can be queried to get statistics about the metadata fields, also known as facets.

Endpoints​

EndpointDescriptionRequest200 Response
POST /v1/articles/statsGets statistics for the indexed articles.ArticleStatsRequestArticleStatsResponse
POST /v1/articles/filter_checkValidates filters against expected article IDs.FilterValidationRequestFilterValidationResponse

POST /v1/articles/stats​

Gets statistics for the indexed articles.

Examples​

Example

Request

{
"facetValuesCount": 5
}

Response

{
"totalCount": 1234,
"facets": [
{
"name": "metadata_field",
"totalCount": 321,
"values": {
"value A": 16,
"value B": 8,
"value C": 4,
"value D": 2,
"value E": 1
}
}
],
"publishedDateMin": "2000-01-01T00:00:00Z",
"publishedDateMax": "2024-12-31T00:00:00Z"
}

POST /v1/articles/filter_check​

Validates a set of article filters against a list of expected article IDs. Returns the IDs that matched and the total count of matching articles in the dataset. See the Filter Validation guide for more details.

Examples​

Example

Request

{
"expectedIds": ["article-1", "article-2", "article-3"],
"articleFilters": {
"sections": "europe"
},
"advancedFilter": {
"type": "literal",
"field": "entities",
"filter": "economy"
}
}

Response

{
"matchedIds": ["article-1", "article-3"],
"totalCount": 42
}