Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amazon-ppc-api

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amazon-ppc-api

This class helps you interfacing the Amazon Advertising API.

  • 1.3.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Advertising API NodeJS client library.

Docs

Amazon Advertising Docs

Guide

Initiate the client

let AdvertisingClient = require('amz-advertising-api');

let client = new AdvertisingClient({
    clientId: "CLIENT_ID",
    clientSecret: "CLIENT_SECRET",
    accessToken: "ACCESS_TOKEN",
    refreshToken: "REFRESH_TOKEN",
    profileId: "PROFILE_ID",
    sandbox: false,
    region: 'eu'
});

await client.init();
Refresh access token

The refresh token gets automaticly refreshed every 2 minutes.

{
  "access_token": "Atza|IQEBLjAsAhRmHjNgHpi0U-Dme37rR6CuUpSR…",
  "expires_in": 3600
}
Set profile Id
client.options.profileId = "1234567890";

Once you've set the profile Id you are ready to start making API calls.

API Calls

List Profiles

List Profiles

let profiles = await client.listProfiles();
[
  {
    "profileId":1234567890,
    "countryCode":"US",
    "currencyCode":"USD",
    "dailyBudget":10.00,
    "timezone":"America/Los_Angeles",
    "accountInfo":{
      "marketplaceStringId":"ABC123",
      "sellerStringId":"DEF456"
    }
  }
]
Get Profile

Retrieves a single profile by Id.

await client.getProfile("1234567890");
{
  "profileId": 1234567890,
  "countryCode": "US",
  "currencyCode": "USD",
  "dailyBudget": 3.99,
  "timezone": "America/Los_Angeles",
  "accountInfo": {
    "marketplaceStringId": "ABC123",
    "sellerStringId": "DEF456"
  }
}
List Portfolios

listPortfolios(filter: {}, extended: false).

Accepts first argument as filter, and the second argument to list for extended details or not.

await client.listPortfolios();
[
  {
    "portfolioId": 1234567890,
    "name": "Portfolio Name",
    "budget": { },
    "inBudget": true,
    "state": "enabled"
  }
]
Get Portfolio

getPortfolio(portfolioId, extended: false).

Accepts first argument as the portfolioId, and the second argument for extended details or not.

await client.getPortfolio(portfolioId);
{
  "portfolioId": 1234567890,
  "name": "Portfolio Name",
  "budget": { },
  "inBudget": true,
  "state": "enabled",
  "creationDate": 202-0101,
  "lastUpdatedDate": 20210101
}

Keywords

FAQs

Package last updated on 27 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc