@scaleleap/amazon-marketplaces
A collection of Amazon Marketplace data objects.
This package is written in TypeScript and is fully typed.
This package combines data about Amazon Marketplace (the consumer side of Amazon) into
a structured class.
Available Marketplace Data
- ID (e.g.
A2EUQ1WTGCTBG2
) - Country code (ISO 3166-1) (e.g.
CA
) - Currency code (ISO 4217) (e.g.
CAD
) - Name (country name) (e.g.
Canada
) - URI (e.g.
https://www.amazon.ca/
) - Amazon Marketplace Web Service (Amazon MWS) endpoint URI
- Amazon Advertising
- API endpoint URI
- Sponsored products
- Sponsored Brands
- Account time zone
Code Demo
Enum of Amazon Marketplace Data
import { amazonMarketplaces } from '@scaleleap/amazon-marketplaces'
const { CA } = amazonMarketplaces
console.log('Amazon Marketplace %s uses currency %s.', CA.name, CA.currency)
List of Amazon Marketplace Data
Sometimes it is more ergonomic to iterate over an array of marketplaces.
And that is where amazonMarketplacesList
may come handy.
import { amazonMarketplacesList } from '@scaleleap/amazon-marketplaces'
const marketplaceIds = amazonMarketplacesList.map(marketplace => marketplace.id)
Utility Functions
import {
findAmazonMarketplace,
findAmazonMarketplaceOrFail,
AmazonMarketplaceCountryCode
} from '@scaleleap/amazon-marketplaces'
const CA = findAmazonMarketplace('countryCode', AmazonMarketplaceCountryCode.CA)
const US = findAmazonMarketplaceOrFail('countryCode', AmazonMarketplaceCountryCode.US)
assertMarketplaceHasAdvertising(CA)
console.log(CA.advertising.countryCode)
Full Data Object Example
{
"countryCode": "CA",
"currency": "CAD",
"id": "A2EUQ1WTGCTBG2",
"name": "Canada",
"uri": "https://www.amazon.ca",
"webServiceUri": "https://mws.amazonservices.ca",
"advertising": {
"countryCode": "CA",
"timeZone": "America/Los_Angeles",
"region": {
"accessTokenUri": "https://api.amazon.com/auth/o2/token",
"authorizationUri": "https://www.amazon.com/ap/oa",
"code": "NA",
"endpoint": "https://advertising-api.amazon.com",
"name": "North America",
},
"bids": {
"sponsoredBrands": {
"min": 10,
"max": 4900
},
"sponsoredProducts": {
"min": 2,
"max": 100000
}
},
}
}
You may also view the Jest snapshot data for the fully rendered data object examples.
Download & Installation
$ npm i -s @scaleleap/amazon-marketplaces
Contributing
If you find any other data that can be added, please open an issue and let us know.
Note that this repository uses Conventional Commit
style commit messages.
If a new marketplace is added, this should be marked as breaking change and increase the major
version, because others may rely on iterating over the available marketplaces.
Original Data Sources
Authors or Acknowledgments
License
This project is licensed under the MIT License.
Badges