> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/api-reference/contextual-targeting/analytics.md).

# Analytics

Operations related to Contextual Targeting Analytics for analyzing targeting list statistics and performance metrics. Track number of targeted URLs, page views, content category distribution, entity extraction effectiveness, and keyword matching rates to optimize contextual targeting strategies and measure privacy-safe audience reach.

## POST /communities/{community\_id}/contextual/analytics/overall\_metrics

> Fetch global contextual targeting analytics

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Analytics","description":"Operations related to Contextual Targeting Analytics for analyzing targeting list statistics and performance metrics. Track number of targeted URLs, page views, content category distribution, entity extraction effectiveness, and keyword matching rates to optimize contextual targeting strategies and measure privacy-safe audience reach."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/communities/{community_id}/contextual/analytics/overall_metrics":{"post":{"requestBody":{"description":"Entities, channels and IABCategory to include or exclude of the analytics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SemanticContextualTargetingQueryDataResource"}}},"required":true},"summary":"Fetch global contextual targeting analytics","operationId":"getOverallAnalytics","parameters":[{"explode":false,"schema":{"type":"string"},"required":true,"in":"path","description":"The community for which you want to look for contextual targeting analytics","style":"simple","name":"community_id"}],"tags":["Analytics"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ContextualTargetingOverallAnalyticsResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"description":""}}},"components":{"schemas":{"SemanticContextualTargetingQueryDataResource":{"type":"object","properties":{"language_name":{"$ref":"#/components/schemas/SemanticQueryLanguage"},"language_version":{"$ref":"#/components/schemas/SemanticQueryLanguageVersion"},"query":{"$ref":"#/components/schemas/SemanticContextualTargetingQueryContentResource"}},"required":["language_name","language_version","query"]},"SemanticQueryLanguage":{"type":"string","enum":["JSON_SEMANTIC"],"readOnly":false},"SemanticQueryLanguageVersion":{"type":"string","enum":["V1"],"readOnly":false},"SemanticContextualTargetingQueryContentResource":{"type":"object"},"ContextualTargetingOverallAnalyticsResource":{"type":"object","properties":{"url_count":{"type":"integer","readOnly":false,"format":"int64","default":0},"last_30_days_page_views":{"default":0,"readOnly":false,"format":"int64","type":"integer"}},"required":["last_30_days_page_views","url_count"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /communities/{community\_id}/contextual/semantic\_extraction

> Fetch the semantic targeting lists per URL

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Analytics","description":"Operations related to Contextual Targeting Analytics for analyzing targeting list statistics and performance metrics. Track number of targeted URLs, page views, content category distribution, entity extraction effectiveness, and keyword matching rates to optimize contextual targeting strategies and measure privacy-safe audience reach."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/communities/{community_id}/contextual/semantic_extraction":{"post":{"description":"","summary":"Fetch the semantic targeting lists per URL","tags":["Analytics"],"parameters":[{"schema":{"type":"string"},"in":"path","explode":false,"style":"simple","description":"The community for which you want to fetch contextual targetings","name":"community_id","required":true}],"requestBody":{"description":"URL to transform into a contextual key in order to have the semantic extraction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SemanticContextualTargetingExtractionQueryResource"}}},"required":true},"operationId":"getTargetingLists","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ContextualTargetingSemanticExtractionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"SemanticContextualTargetingExtractionQueryResource":{"type":"object","properties":{"url":{"type":"string","readOnly":false},"channel_id":{"type":"string","readOnly":false}},"required":["channel_id","url"]},"ContextualTargetingSemanticExtractionResource":{"type":"object","properties":{"targeting_lists":{"type":"array","items":{"$ref":"#/components/schemas/TargetingList"},"readOnly":false}},"required":["targeting_lists"]},"TargetingList":{"type":"object","properties":{"id":{"type":"string","readOnly":false}},"required":["id"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /communities/{community\_id}/contextual/analytics/channels

> Fetch contextual targeting analytics for all authorized channels

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Analytics","description":"Operations related to Contextual Targeting Analytics for analyzing targeting list statistics and performance metrics. Track number of targeted URLs, page views, content category distribution, entity extraction effectiveness, and keyword matching rates to optimize contextual targeting strategies and measure privacy-safe audience reach."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/communities/{community_id}/contextual/analytics/channels":{"post":{"parameters":[{"required":true,"description":"The community for which you want to look for contextual targeting analytics","schema":{"type":"string"},"explode":false,"in":"path","name":"community_id","style":"simple"}],"operationId":"getChannelsAnalytics","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"count":{"type":"integer"},"first_result":{"type":"integer"},"max_results":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ContextualTargetingChannelsAnalyticsResource"}}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Fetch contextual targeting analytics for all authorized channels","tags":["Analytics"],"requestBody":{"description":"Entities, channels and IABCategory to include or exclude of the analytics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SemanticContextualTargetingQueryDataResource"}}},"required":true},"description":""}}},"components":{"schemas":{"ContextualTargetingChannelsAnalyticsResource":{"type":"object","properties":{"id":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"last_30_days_page_views":{"format":"int64","type":"integer","default":0,"readOnly":false}},"required":["id","last_30_days_page_views","name"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]},"SemanticContextualTargetingQueryDataResource":{"type":"object","properties":{"language_name":{"$ref":"#/components/schemas/SemanticQueryLanguage"},"language_version":{"$ref":"#/components/schemas/SemanticQueryLanguageVersion"},"query":{"$ref":"#/components/schemas/SemanticContextualTargetingQueryContentResource"}},"required":["language_name","language_version","query"]},"SemanticQueryLanguage":{"type":"string","enum":["JSON_SEMANTIC"],"readOnly":false},"SemanticQueryLanguageVersion":{"type":"string","enum":["V1"],"readOnly":false},"SemanticContextualTargetingQueryContentResource":{"type":"object"}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /communities/{community\_id}/contextual/analytics/top\_urls

> Fetch the most viewed urls

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Analytics","description":"Operations related to Contextual Targeting Analytics for analyzing targeting list statistics and performance metrics. Track number of targeted URLs, page views, content category distribution, entity extraction effectiveness, and keyword matching rates to optimize contextual targeting strategies and measure privacy-safe audience reach."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/communities/{community_id}/contextual/analytics/top_urls":{"post":{"description":"","tags":["Analytics"],"parameters":[{"explode":false,"required":true,"schema":{"type":"string"},"in":"path","name":"community_id","description":"The community for which you want to look for contextual targeting analytics","style":"simple"},{"name":"first_result","in":"query","style":"form","explode":true,"description":"Offset from which the search must be performed","schema":{"type":"integer","format":"int32"},"required":false},{"style":"form","in":"query","schema":{"type":"integer","format":"int32"},"required":false,"explode":true,"name":"max_results","description":"Number of maximum items that shall be return by this search"}],"operationId":"getTopUrls","summary":"Fetch the most viewed urls","requestBody":{"description":"Entities, channels and IABCategory to include or exclude of the analytics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SemanticContextualTargetingQueryDataResource"}}},"required":true},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"max_results":{"type":"integer"},"total":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ContextualTargetingTopUrlsAnalyticsResource"}},"first_result":{"type":"integer"},"count":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"SemanticContextualTargetingQueryDataResource":{"type":"object","properties":{"language_name":{"$ref":"#/components/schemas/SemanticQueryLanguage"},"language_version":{"$ref":"#/components/schemas/SemanticQueryLanguageVersion"},"query":{"$ref":"#/components/schemas/SemanticContextualTargetingQueryContentResource"}},"required":["language_name","language_version","query"]},"SemanticQueryLanguage":{"type":"string","enum":["JSON_SEMANTIC"],"readOnly":false},"SemanticQueryLanguageVersion":{"type":"string","enum":["V1"],"readOnly":false},"SemanticContextualTargetingQueryContentResource":{"type":"object"},"ContextualTargetingTopUrlsAnalyticsResource":{"type":"object","properties":{"url":{"type":"string","readOnly":false},"last_30_days_page_views":{"default":0,"format":"int64","type":"integer","readOnly":false}},"required":["last_30_days_page_views","url"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/api-reference/contextual-targeting/analytics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
