apple-search-ads
v0.0.2
Published
Apple Search Ads API
Downloads
2
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:
- Certificate – it can be created and downloaded here: https://app.searchads.apple.com/cm/app/settings/apicertificates
- Company/Account name – it can be found here: https://app.searchads.apple.com/cm/app/settings/overview (Legal Name).
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