Skip to main content

Yandex.Market seller API client

Project description

ya-market-api codecov

Python3 client for public API of yandex market

Installation

# Sync only mode
pip install ya-market-api[sync]
# Async only mode
pip install ya-market-api[async]
# All modes
pip install ya-market-api[all]

Instantiating

There are several ways to work with the API (synchronous and asynchronous). Both interfaces have the same signatures, the only difference is the need to use async/await keywords.

from ya_market_api.sync_api import SyncAPI		# Sync mode
from ya_market_api.async_api import AsyncAPI		# Async mode


def main() -> None:
	api = SyncAPI.build(
		api_key="...",
		base_url=...,		# (optional) may be used for test circuits
		business_id=...,		# (optional) required for the Feedback API
		campaign_id=...,		# (optional) required for the Order API
	)

	# Do things here...


async def main() -> None:
	api = await AsyncAPI.build(
		api_key="...",
		base_url=...,		# (optional) may be used for test circuits
		business_id=...,		# (optional) required for the Feedback API
		campaign_id=...,		# (optional) required for the Order API
	)

	# Do things here...

	await api.close()

Where can I get api key?

See official docs.

Guide API

Get token info

# Sync mode
from ya_market_api.sync_api import SyncAPI


api = SyncAPI.build(...)
response = api.guide.get_token_info()

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/auth/getAuthTokenInfo

Get delivery services

# Sync mode
from ya_market_api.sync_api import SyncAPI


api = SyncAPI.build(...)
response = api.guide.get_delivery_services()

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/orders/getDeliveryServices

Guide Region API

Get region countries

# Sync mode
from ya_market_api.sync_api import SyncAPI


api = SyncAPI.build(...)
response = api.guide.region.get_region_countries()

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/regions/getRegionsCodes

Search region

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.guide.region.dataclass import RegionSearchRequest


api = SyncAPI.build(...)
request = RegionSearchRequest(name="Москва", limit=100, page_token=None)
response = api.guide.region.search_region(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/regions/searchRegionsByName

Get region info

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.guide.region.dataclass import RegionInfoRequest


api = SyncAPI.build(...)
request = RegionInfoRequest(region_id=1)
response = api.guide.region.get_region_info(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/regions/searchRegionsById

Get region children

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.guide.region.dataclass import RegionChildrenRequest


api = SyncAPI.build(...)
request = RegionChildrenRequest(region_id=1, page=1, page_size=10)
response = api.guide.region.get_region_children(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/regions/searchRegionChildren

Feedback API

Get feedback list

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.feedback.dataclass import FeedbackListRequest

from arrow import get


api = SyncAPI.build(...)
response = api.feedback.get_feedback_list()
# or
request = FeedbackListRequest(datetime_from=get(2025, 1, 1), date_to=get(2025, 1, 31))
response = api.feedback.get_feedback_list(request)

See signature of the FeedbackListRequest class and the docs to get info about all available params.

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/goods-feedback/getGoodsFeedbacks

Get feedback comment list

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.feedback.dataclass import FeedbackCommentListRequest


api = SyncAPI.build(...)
request = FeedbackCommentListRequest(feedback_id=512)
response = api.feedback.get_feedback_comment_list(request)

See signature of the FeedbackCommentListRequest class and the docs to get info about all available params.

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/goods-feedback/getGoodsFeedbackComments

Add feedback comment

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.feedback.dataclass import FeedbackCommentAddRequest


api = SyncAPI.build(...)
request = FeedbackCommentAddRequest.create(feedback_id=512, text="COMMENT_TEXT", parent_id=1024)
response = api.feedback.add_feedback_comment(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/goods-feedback/updateGoodsFeedbackComment

Update feedback comment

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.feedback.dataclass import FeedbackCommentUpdateRequest


api = SyncAPI.build(...)
request = FeedbackCommentUpdateRequest.create(feedback_id=512, comment_id=2048, text="COMMENT_TEXT")
response = api.feedback.update_feedback_comment(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/goods-feedback/updateGoodsFeedbackComment

Delete feedback comment

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.feedback.dataclass import FeedbackCommentDeleteRequest


api = SyncAPI.build(...)
request = FeedbackCommentDeleteRequest(id=512)
response = api.feedback.delete_comment_feedback(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/goods-feedback/deleteGoodsFeedbackComment

Skip feedback reaction

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.feedback.dataclass import FeedbackReactionSkipRequest


api = SyncAPI.build(...)
request = FeedbackReactionSkipRequest(feedback_ids=(64, 128, 256))
response = api.feedback.skip_feedback_reaction(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/goods-feedback/skipGoodsFeedbacksReaction

Offer API

Get offer list by business id

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.offer.dataclass import OfferListByBusinessRequest


api = SyncAPI.build(...)
response = api.offer.get_offer_list_by_business()
# or
request = OfferListByBusinessRequest(category_ids=[1, 2, 3], limit=10)
response = api.offer.get_offer_list_by_business(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/business-assortment/getOfferMappings

Campaign API

Get campaign list

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.campaign.dataclass import CampaignListRequest


api = SyncAPI.build(...)
response = api.campaign.get_campaign_list()
# or
request = CampaignListRequest(page=1)
response = api.campaign.get_campaign_list(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/campaigns/getCampaigns

Order API

Get order

# Sync mode
from ya_market_api.sync_api import SyncAPI
from ya_market_api.order.dataclass import OrderGetRequest


api = SyncAPI.build(...)
request = OrderGetRequest(order_id=...)
response = api.order.get_order(request)

Docs: https://yandex.ru/dev/market/partner-api/doc/ru/reference/orders/getOrder

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ya_market_api-2.0.0.tar.gz (206.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ya_market_api-2.0.0-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file ya_market_api-2.0.0.tar.gz.

File metadata

  • Download URL: ya_market_api-2.0.0.tar.gz
  • Upload date:
  • Size: 206.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ya_market_api-2.0.0.tar.gz
Algorithm Hash digest
SHA256 51fd22c9337b4c9ec8f4e223b2f4149e9fb12d014b1f1e12f0f8573e4702e4bf
MD5 cb610b388edde2b20b796ba5f5b8e534
BLAKE2b-256 589bbd67dbdf5381c9a0b8d5cc770b13de8d445591eb7582770c52ee3a10bea1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ya_market_api-2.0.0.tar.gz:

Publisher: publish.yml on Kirill-Lekhov/ya-market-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ya_market_api-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: ya_market_api-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 49.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ya_market_api-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 502dfbb7d6da3f3458f1265f77c7b75a5ebd6c4d464f60af2fadbb5765a3d282
MD5 4b3f0a853ec5615230a1e11c603aa2ba
BLAKE2b-256 543457997da1dcc50cc7a4c2f9d8a9cc4baab676826a4fad92695d3209286e54

See more details on using hashes here.

Provenance

The following attestation bundles were made for ya_market_api-2.0.0-py3-none-any.whl:

Publisher: publish.yml on Kirill-Lekhov/ya-market-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page