https://github.com/open-inflation/perekrestok_api
Perekrestok API sync client
https://github.com/open-inflation/perekrestok_api
parser perekrestok playwright python3 sync
Last synced: 5 months ago
JSON representation
Perekrestok API sync client
- Host: GitHub
- URL: https://github.com/open-inflation/perekrestok_api
- Owner: Open-Inflation
- License: mit
- Created: 2025-01-05T01:56:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-28T17:37:03.000Z (6 months ago)
- Last Synced: 2025-08-28T21:56:07.799Z (6 months ago)
- Topics: parser, perekrestok, playwright, python3, sync
- Language: Python
- Homepage: https://pypi.org/project/perekrestok-api/
- Size: 344 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Perekrestok API (not official)

[](https://github.com/Open-Inflation/perekrestok_api/actions/workflows/tests.yml)


[](https://pypi.org/project/perekrestok-api/)
[](https://github.com/Open-Inflation/perekrestok_api/blob/main/LICENSE)
[](https://discord.gg/UnJnGHNbBp)
[](https://t.me/miskler_dev)
Perekrestok (Перекрёсток) - https://www.perekrestok.ru/
**[⭐ Star us on GitHub](https://github.com/Open-Inflation/perekrestok_api)** | **[📚 Read the Docs](https://open-inflation.github.io/perekrestok_api/quick_start)** | **[🐛 Report Bug](https://github.com/Open-Inflation/perekrestok_api/issues)**
### Принцип работы
> Библиотека полностью повторяет сетевую работу обычного пользователя на сайте.
# Usage
```bash
pip install perekrestok_api
python -m hrequests install
```
```py
from perekrestok_api import PerekrestokAPI
from perekrestok_api import abstraction
def main():
with PerekrestokAPI() as Api:
geopos_handler = Api.Geolocation.current()
geopos = geopos_handler.json()
print(f'Текущий город сессии {geopos["content"]["city"]["name"]} ({geopos["content"]["city"]["id"]})')
# Получаем список категорий
categories = Api.Catalog.tree()
cat = categories.json()
print(f'Список категорий: {len(cat["content"]["items"])}')
# Выводим первую категорию
print(f'Категория: {cat["content"]["items"][0]["category"]["title"]} ({cat["content"]["items"][0]["category"]["id"]})')
# Получаем список товаров
filter = abstraction.CatalogFeedFilter()
filter.CATEGORY_ID = cat["content"]["items"][0]["category"]["id"]
products = Api.Catalog.feed(filter=filter)
prod = products.json()
# Выводим первый товар
print(f'Первый товар: {prod["content"]["items"][0]["title"]} ({prod["content"]["items"][0]["id"]})')
if __name__ == "__main__":
main()
```
```bash
> Текущий город сессии Москва (81)
> Список категорий: 31
> Категория: Летний сезон (1585)
> Первый товар: Пиво Василеостровское Тройной пшеничный эль нефильтрованное 6.9%, 750мл (66750)
```
Для более подробной информации смотрите референсы [документации](https://open-inflation.github.io/perekrestok_api/quick_start).
---
### Report
If you have any problems using it / suggestions, do not hesitate to write to the [project's GitHub](https://github.com/Open-Inflation/perekrestok_api/issues)!