https://github.com/pavelmaksimov/marilyn-api
Async client for Marilyn API
https://github.com/pavelmaksimov/marilyn-api
api async client marilyn python
Last synced: 4 months ago
JSON representation
Async client for Marilyn API
- Host: GitHub
- URL: https://github.com/pavelmaksimov/marilyn-api
- Owner: pavelmaksimov
- License: mit
- Created: 2022-03-27T07:54:20.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-27T07:58:17.000Z (about 4 years ago)
- Last Synced: 2025-08-27T12:16:47.467Z (10 months ago)
- Topics: api, async, client, marilyn, python
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://raw.githubusercontent.com/vintasoftware/marilyn-api/master/LICENSE)
[](https://pepy.tech/project/marilyn-api)

# Async client for Marilyn API
## Installation
pip install marilyn-api
## Examples
```python
from marilyn_api import AsyncClient
api_root = "https://app.mymarilyn.ru"
headers = {
"X-API-Account": 100500,
"X-API-Token": "{auth token}",
}
aclient = AsyncClient(api_root, headers=headers)
body = {
"channel_id": [],
"start_date": "2022-02-01",
"end_date": "2022-02-18",
"date_grouping": "day",
"grouping": "placement",
"filtering": [
{
"entity": "no",
"entities": []
},
{
"entity": "project",
"entities": [
4551
]
}
],
"custom_metrics": [],
"profiles": [],
"goals": [],
"with_vat": False,
"per_page": 200,
"sorting": "date",
"columns": [
"date",
"placement_id",
"placement_name",
"campaign_xid",
"channel_id",
"impressions",
"clicks",
"cpm_fact",
"reach_total_sum",
"viral_reach_total_sum",
"ctr",
"cost_fact",
"cpc_fact",
"orders",
"model_orders",
"revenue",
"revenue_model_orders"
]
}
async for page in aclient.iter_statistics_detailed(body):
for item in page["items"]:
print("RECORD:", item)
```
## Script examples
```bash
python Examples/statistics_detailed.py --help
python Examples/statistics_detailed.py -r https://app.mymarilyn.ru -a 100500 -t MytoKeN12345 -c Examples/detailed-stats-config.json
```
```bash
python Examples/project_placements.py.py --help
python Examples/project_placements.py.py -r https://app.mymarilyn.ru -a 100500 -p 12345 -t MytoKeN12345
```
## Dependencies
- aiohttp
## Author
Pavel Maksimov
You can contact me at
[Telegram](https://teleg.run/pavel_maksimow)
Удачи тебе, друг! Поставь звездочку ;)