Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doesdev/target-api
Very limited abstraction over Target APIs
https://github.com/doesdev/target-api
Last synced: about 20 hours ago
JSON representation
Very limited abstraction over Target APIs
- Host: GitHub
- URL: https://github.com/doesdev/target-api
- Owner: doesdev
- Created: 2016-08-07T03:41:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-26T23:14:53.000Z (over 7 years ago)
- Last Synced: 2024-11-10T16:53:17.139Z (9 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# target-api [![npm version](https://badge.fury.io/js/target-api.svg)](http://badge.fury.io/js/target-api) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)
A very limited abstraction over Target APIs. Currently only supports 2 API methods [`stores`, `search`].
### Requires Target API key(s) [`stores` uses API v2, `search` uses API v1]
I have no idea where you get those from as they don't appear to have open API access.That being said the v2 API is used by the website's store locator and v1 is used by the mobile app.
## install
`npm i target-api`## programmatic usage
Provide API key (required)
```javascript
const targetApi = require('target-api')// get array of stores
const storesOpts = {key: 'someV2ApiKey', nearby: 33803, range: 50, limit: 50}
targetApi.stores(storesOpts, (err, data) => console.log(err || data))// get product search results
const searchOpts = {key: 'someV1ApiKey', store: 1299, query: '4k tv'}
targetApi.search(searchOpts, (err, data) => console.log(err || data))
```