apple-search-ads

Apple Search Ads API

Usage no npm install needed!

<script type="module">
  import appleSearchAds from 'https://cdn.skypack.dev/apple-search-ads';
</script>

README

Apple Search Ads SDK

Unofficial Apple Search Ads SDK for Node

Installation

With NPM:

npm install apple-search-ads

or with Yarn

yarn add apple-search-ads

Usage

This module is designed to be easily updatable and match Apple's API paths and built on top of axios.

You'll need the following to get started:

Note that the SDK supports you passing a file path for the certificates, or passing a buffer of them.

Examples


const AppleSearchAds = require('apple-search-ads');

let sdk = new AppleSearchAds({
  certificate: {
    pem: './certs/pemCert.pem', // also accepts a Buffer with the cert
    key: './certs/keyCert.key' // also accept Buffer with the key
  },
  account: 'Account Name',
  version: 'v1' // optional
});

let report = await sdk.reports.campaigns.create({
  startTime: '2018-11-01',
  endTime: '2018-11-08',
  granularity: 'DAILY',
  selector: {
    orderBy: [{"field":"localSpend","sortOrder":"DESCENDING"}]
  }
});

console.log('report.status', report.status)
console.log('report.response', report.data);


let campaigns = await sdk.campaigns({ ... })

console.log('campaigns.status', campaigns.status)
console.log('campaigns.response', campaigns.data)

Support

The following endpoints namespaces are supported:

License

MIT