where to find mapping info between country codes and full country names ? #226
Replies: 1 comment
-
Here: https://github.com/denisneuf/python-amazon-ad-api/blob/main/ad_api/base/marketplaces.py Please notice the readme files: Marketplaces are used to define basically the API endpoints Amazon need to use depending on the regions, by default it will use EU so if you are using one of the marketplaces that are under the Europe (EU). Covers UK, FR, IT, ES, DE, NL, AE, SE, PL, and TR marketplaces you can skip. If you are using either North America (NA) or Far East (FE), you will need import from base and pass the marketplace as follows: from ad_api.api import sponsored_products You can pass NA or US, CA, MX or BR for North America and JP, AU or SG for Far Eastresult=sponsored_products.CampaignsV3(marketplace=Marketplaces.NA).list_campaigns() |
Beta Was this translation helpful? Give feedback.
-
In the credentials.yml example, country names are used in full form (e.g., "germany",...), but in the API code (like marketplaces.py), countries are referenced using their ISO codes (e.g., "DE", "GB").
In the whole API docs, is there any file with mapping between country codes and full country names ?
MARKET_CODE_TO_NAME = {
'UK': 'united_kingdom',
'GB': 'united_kingdom',
'DE': 'germany',
'FR': 'france',
# etc.
}
My questions:
This would greatly simplify implementation for users who wouldn't need to create and maintain this mapping in every script they write.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions