FixPrice API (not official)
FixPrice (Фикс Прайс) - https://fix-price.com/
⭐ Star us on GitHub | 📚 Read the Docs | 🐛 Report Bug
Принцип работы
Библиотека полностью повторяет сетевую работу обычного пользователя на сайте.
pip install fixprice_api
python -m camoufox fetch
import asyncio
from fixprice_api import FixPriceAPI, CatalogSort
from PIL import Image
async def main():
async with FixPriceAPI() as api:
# 1. Получаем дерево категорий
tree_data = (await api.Catalog.tree()).json()
first_alias = tree_data[next(iter(tree_data))]["alias"]
print(f"Первая категория: {first_alias}")
# 2. Список товаров в категории
products = (
await api.Catalog.products_list(
category_alias=first_alias,
page=1,
limit=24,
sort=CatalogSort.POPULARITY,
)
).json()
first_product_id = products[0]["id"]
first_product_url = products[0]["url"]
print(f"Первый товар: {products[0]['title']!s:.60s} ({first_product_id})")
# 3. Геолокация (влияет на каталог и баланс)
cities = (await api.Geolocation.cities_list(country_id=2)).json() # Россия
api.city_id = cities[0]["id"]
print(f"Текущий city_id: {api.city_id}")
# 4. Проверка наличия товара по магазинам
balance = (await api.Catalog.Product.balance(product_id=first_product_id)).json()
print(f"Проверено магазинов: {len(balance)}")
# 5. Подробное инфо о товаре
info = (await api.Catalog.Product.info(url=first_product_url)).json()
print(f"Подробно о товаре: {list(info.keys())}")
# 6. Загрузка изображения
image_url = products[0]["images"][0]["src"]
image_stream = await api.General.download_image(image_url)
with Image.open(image_stream) as img:
print(f"Image format: {img.format}, size: {img.size}")
if __name__ == "__main__":
asyncio.run(main())
> Первая категория: kosmetika-i-gigiena
> Первый товар: Крем для рук и тела, 150 мл (2345678)
> Текущий city_id: 3
> Проверено магазинов: 339
> Image format: WEBP, size: (190, 190)
Для более подробной информации смотрите референсы документации.
Автотесты API (pytest + snapshots)
В проекте используется автотест-фреймворк из human_requests:
- endpoint-методы в бизнес-коде помечаются
@autotest; - pytest-плагин сам находит эти методы и запускает их;
- JSON-ответы проверяются через
pytest-jsonschema-snapshot(schemashot); - параметры вызова и пост-обработка результата регистрируются в
tests/api_test.pyчерез:@autotest_params@autotest_hook@autotest_depends_on
Минимальная конфигурация уже включена в pyproject.toml:
[tool.pytest.ini_options]
anyio_mode = "auto"
autotest_start_class = "fixprice_api.FixPriceAPI"
Запуск тестов:
pytest
Важно:
- используется
pytest-anyio(неpytest-asyncio); - ручные тесты остаются только для кейсов, которые не относятся к JSON-схемам endpoint-методов (например,
download_image).
Report
If you have any problems using it / suggestions, do not hesitate to write to the project's GitHub!
Metadata
Release files for fixprice-api 0.2.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fixprice_api-0.2.4.1.tar.gz | 14.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fixprice_api-0.2.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.1 kB
Release files / fixprice_api-0.2.4.1.tar.gz
| Download URL | fixprice_api-0.2.4.1.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cbf43613eca27da56ab12c383b7dc76f9849092a663a5efccb60656896931bcc
|
|
BLAKE2b-256 checksum How to use checksums |
7246e1b81075dc0f2c390adaac6ce7573bcbe1f74ec0ee85bbe288c2263ed3ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.
Transparency logRelease files / fixprice_api-0.2.4.1-py3-none-any.whl
| Download URL | fixprice_api-0.2.4.1-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91abb034284f383af7aca15a4859d35c9e423cda5f0141dca2def11413947430
|
|
BLAKE2b-256 checksum How to use checksums |
b110ea572784fb246e6396cff99be781a0ac8fe1f72d101d262ca5348e824f0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.
Transparency log