# instagram-node-api

> A node wrapper to Instagram API

Latest version **1.6.0** (published 2017-05-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install instagram-node-api
pnpm add instagram-node-api
yarn add instagram-node-api
bun add instagram-node-api
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.0 |
| Published | 2017-05-30 |
| First published | 2016-10-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Felipe Lima |
| Maintainers | limafelipe |

## Links

- npm: https://www.npmjs.com/package/instagram-node-api
- Repository: https://github.com/limafelipe/instagram-node-api
- Homepage: https://github.com/limafelipe/instagram-node-api#readme
- Issues: https://github.com/limafelipe/instagram-node-api/issues
- npm.io page: https://npm.io/package/instagram-node-api

## Dependencies (2)

- [got](https://npm.io/package/got.md) ^6.5.0
- [lodash](https://npm.io/package/lodash.md) ^4.16.4

## Recent versions

- 1.6.0 (latest) — 2017-05-30
- 1.5.0 — 2017-04-04
- 1.4.0 — 2017-03-13
- 1.3.0 — 2017-02-20
- 1.2.0 — 2017-02-15
- 1.1.0 — 2017-02-15
- 1.0.10 — 2016-10-31
- 1.0.9 — 2016-10-31
- 1.0.8 — 2016-10-28
- 1.0.7 — 2016-10-27
- 1.0.6 — 2016-10-27
- 1.0.5 — 2016-10-26
- 1.0.4 — 2016-10-26
- 1.0.3 — 2016-10-19
- 1.0.2 — 2016-10-19
- … 2 more at https://npm.io/package/instagram-node-api/versions

## README

# instagram-node-api [![Build Status](https://travis-ci.org/squidit/instagram-node-api.svg?branch=master)](https://travis-ci.org/squidit/instagram-node-api) ![[Depencies status](https://david-dm.org/squidit/instagram-node-api/)](https://david-dm.org/squidit/instagram-node-api.svg) [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/)

**BETA** - A node wrapper to [Instagram API](https://www.instagram.com/developer/endpoints/) 😄

## Status
- [**GET** /users/search](https://www.instagram.com/developer/endpoints/users/#get_users_search).
- [**GET** /users/self](https://www.instagram.com/developer/endpoints/users/#get_users_self).
- [**GET** /users/self/media/recent](https://www.instagram.com/developer/endpoints/users/#get_users_media_recent_self).
- [**GET** /tags/*tag-name*/media/recent](https://www.instagram.com/developer/endpoints/tags/#get_tags_media_recent).
- [**GET** /tags/*user-id*/media/recent](https://www.instagram.com/developer/endpoints/users/#get_users_media_recent).

Another's coming soon.

## Usage
`npm install --save instagram-node-api`

```js
const InstagramNodeApi = require('instagram-node-api');

const instagramNodeApi = new InstagramNodeApi(YOUR_ACCESS_TOKEN);

instagramNodeApi.on('data', ([*]) => { });
instagramNodeApi.on('finish', ([*]) => { });
instagramNodeApi.on('err', (error) => { });
```

## Users
#### Search users by quering username.
```js
instagramNodeApi.userSearch(username);

instagramNodeApi.on('data', (profiles, meta, remaining, limit, result) => {
});

instagramNodeApi.on('finish', (profiles, meta, remaining, limit, result) => {
});
```

#### Get information about the owner of the access_token.
```js
instagramNodeApi.usersSelf();

instagramNodeApi.on('data', (profile, meta, remaining, limit, result) => {
});

instagramNodeApi.on('finish', (profile, meta, remaining, limit, result) => {
});
```

#### Get information about the user
```js
instagramNodeApi.user(id);

instagramNodeApi.on('data', (profile, meta, remaining, limit, result) => {
});

instagramNodeApi.on('finish', (profile, meta, remaining, limit, result) => {
});
```

#### Get the most recent media published by the id of the user
```js
instagramNodeApi.usersMediaRecent(userid);

instagramNodeApi.on('data', (data, pagination, meta, remaining, limit, result) => {
});

instagramNodeApi.on('finish', (data, pagination, meta, remaining, limit, result) => {
});

instagramNodeApi.on('err', (error) => { });
```

#### Get the most recent media published by the owner of the access_token..
```js
instagramNodeApi.usersSelfMediaRecent();

instagramNodeApi.on('data', (data, pagination, meta, remaining, limit, result) => {
});

instagramNodeApi.on('finish', (data, pagination, meta, remaining, limit, result) => {
});

instagramNodeApi.on('err', (error) => { });
```

## Tags
#### Get the most recent media published by the owner of the access_token..
```js
instagramNodeApi.tagsMediaRecent(tagName, [dateLimit = null], [limit = 0]);

instagramNodeApi.on('data', (data, pagination, meta, remaining, limit, result) => {
});

instagramNodeApi.on('finish', (data, pagination, meta, remaining, limit, result) => {
});

instagramNodeApi.on('err', (error) => { });
``` 

- **tagName**: *String* 
- **dateLimit**: *Date*
- **limit***: *Number*

#### Usage
```js
instagramNodeApi.tagsMediaRecent(tagName); // => Returns last 33 medias from tag
instagramNodeApi.tagsMediaRecent(tagName, new Date()); // => Stop the search when founded some media which is greater than the date informed
instagramNodeApi.tagsMediaRecent(tagName, new Date(), 1000); // => Stop the search when founded some media which is greater than the date informed or the limit
instagramNodeApi.tagsMediaRecent(tagName, 1000); // => Stop the search when the number of founded medias is greater than the limit informed

``` 

## Tests
Include a `.env` file with:

```
TEST_INSTAGRAM_ACCESS_TOKEN=YOUR_ACCESS_TOKEN
```

And just run `npm test`

## Contributing
Currently this is very basic for my needs, PRs are welcome 🙏

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