# apple-search-ads

> Apple Search Ads API

Latest version **0.0.2** (published 2018-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install apple-search-ads
pnpm add apple-search-ads
yarn add apple-search-ads
bun add apple-search-ads
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-11-10 |
| First published | 2018-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 25.9 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| Author | Nima Gardideh |
| Maintainers | nimsical |

## Links

- npm: https://www.npmjs.com/package/apple-search-ads
- Repository: https://github.com/nemo/node-apple-search-ads
- Homepage: https://github.com/nemo/node-apple-search-ads#readme
- Issues: https://github.com/nemo/node-apple-search-ads/issues
- npm.io page: https://npm.io/package/apple-search-ads

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.18.0
- [https](https://npm.io/package/https.md) ^1.0.0

## Recent versions

- 0.0.2 (latest) — 2018-11-10

## 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](https://github.com/axios/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

```javascript

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:

- [Campaign Management](https://github.com/nemo/node-apple-search-ads/blob/master/endpoints/campaigns.js)
- [Reports](https://github.com/nemo/node-apple-search-ads/blob/master/endpoints/reports.js)


## License
MIT

---
_Source: https://npm.io/package/apple-search-ads · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
