Skip to content

Commit

Permalink
v0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
denisneuf committed Feb 23, 2024
1 parent 57c09d1 commit b1f3ef0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ad_api/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .recommendations import Recommendations
from .stream import Stream
from .exports import Exports
from .stores import Stores

__all__ = [
"sp",
Expand Down Expand Up @@ -49,4 +50,5 @@
"Recommendations",
"Stream",
"Exports",
"Stores"
]
32 changes: 32 additions & 0 deletions ad_api/api/stores.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse, Utils


class Stores(Client):
"""
Brand Metrics provides a new measurement solution that quantifies opportunities for your brand at each stage of the customer journey on Amazon, and helps brands understand the value of different shopping engagements that impact stages of that journey. You can now access Awareness and Consideration indices that compare your performance to peers using models predictive of consideration and sales. Brand Metrics quantifies the number of customers in the awareness and consideration marketing funnel stages and is built at scale to measure all shopping engagements with your brand on Amazon, not just ad-attributed engagements. Additionally, BM breaks out key shopping engagements at each stage of the shopping journey, along with the Return on Engagement, so you can measure the historical sales following a consideration event or purchase.
"""

@sp_endpoint('/stores/{}/asinMetrics', method='POST')
def get_asin_engagement_for_store(self, brandEntityId, version: int = 1, **kwargs) -> ApiResponse:
r"""
getAsinEngagementForStore
"""
content_type = 'application/vnd.GetAsinEngagementForStoreRequest.v'+ str(version) +'+json'
accept = 'application/vnd.GetAsinEngagementForStoreResponse.v'+ str(version) +'+json'
headers = {'Content-Type': content_type, 'Accept': accept}
return self._request(fill_query_params(kwargs.pop('path'), brandEntityId), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)

@sp_endpoint('/stores/{}/insights', method='GET')
def get_insights_for_store_api(self, brandEntityId, version: int = 1, **kwargs) -> ApiResponse:
r"""
getInsightsForStoreAPI
"""
content_type = 'application/vnd.GetInsightsForStoreRequest.v'+ str(version) +'+json'
# accept = 'application/vnd.GetInsightsForStoreResponse.v'+ str(version) +'+json'
# headers = {'Content-Type': content_type, 'Accept': accept}
return self._request(fill_query_params(kwargs.pop('path'), brandEntityId),
data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs)
# return self._request(fill_query_params(kwargs.pop('path'), brandEntityId), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)



2 changes: 1 addition & 1 deletion ad_api/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.5"
__version__ = "0.5.6"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = python-amazon-ad-api
version = 0.5.5
version = 0.5.6
author = Daniel Alvaro
author_email = [email protected]
description = Python wrapper for the Amazon Advertising API
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='python-amazon-ad-api',
version='0.5.5',
version='0.5.6',
install_requires=[
"requests>=2.27.1,<2.32.0",
"six~=1.16.0",
Expand Down

0 comments on commit b1f3ef0

Please sign in to comment.