---
title: "Get articles with faceting for analytics"
description: "Use faceting to get aggregated counts grouped by fields for analytics dashboards"
source: https://apitube.io/cookbook/get-articles-with-faceting-for-analytics
---

#### Input parameters

| Parameter    | Description                                    | Type    | Default | Required |
|:-------------|:-----------------------------------------------|:--------|:--------|:---------|
| facet        | Enable faceting (set to true or 1).            | boolean |         | Yes      |
| facet.field  | Comma-separated list of fields to facet on.    | string  |         | Yes      |
| facet.limit  | Maximum number of facet values per field.      | integer | 10      | No       |
| api_key      | Your API key.                                  | string  |         | Yes      |
| per_page     | Maximum number of articles to retrieve.       | integer | 20      | No       |

#### Workflow examples

##### Request with basic faceting by source:

```shell
curl -X GET "https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id&api_key=YOUR_API_KEY"
```

##### Request with multiple facet fields:

```shell
curl -X GET "https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id,language.id,sentiment.overall.polarity&api_key=YOUR_API_KEY"
```

##### Request for sentiment analysis by source:

```shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&facet=true&facet.field=source.id,sentiment.overall.polarity&facet.limit=10&api_key=YOUR_API_KEY"
```

---

#### Related Examples

- [Get articles with range faceting](/cookbook/get-articles-with-range-faceting-for-timelines)
- [Select specific fields](/cookbook/select-specific-fields-to-reduce-payload-size)
- [Sort by engagement score](/cookbook/sort-articles-by-engagement-score)
- [Find articles with mixed sentiment](/cookbook/find-articles-with-mixed-sentiment)
- [Get news in specific categories](/cookbook/get-news-in-categories)

