instagram-node-api
v1.6.0
Published
A node wrapper to Instagram API
Downloads
9
Readme
instagram-node-api
BETA - A node wrapper to Instagram API 😄
Status
- GET /users/search.
- GET /users/self.
- GET /users/self/media/recent.
- GET /tags/tag-name/media/recent.
- GET /tags/user-id/media/recent.
Another's coming soon.
Usage
npm install --save instagram-node-api
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.
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.
instagramNodeApi.usersSelf();
instagramNodeApi.on('data', (profile, meta, remaining, limit, result) => {
});
instagramNodeApi.on('finish', (profile, meta, remaining, limit, result) => {
});
Get information about the user
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
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..
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..
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
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 🙏