Skip to content
This repository has been archived by the owner on May 28, 2020. It is now read-only.

squidit/instagram-node-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

63 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

instagram-node-api Build Status Depencies status Standard - JavaScript Style Guide

BETA - A node wrapper to Instagram API ๐Ÿ˜„

Status

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, [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) => { });
  • userId: Number
  • dateLimit: Date
  • limit: Number

Usage

instagramNodeApi.usersMediaRecent(userId); // => Returns last 33 medias from user
instagramNodeApi.usersMediaRecent(userId, new Date()); // => Stop the search when founded some media which is greater than the date informed
instagramNodeApi.usersMediaRecent(userId, new Date(), 1000); // => Stop the search when founded some media which is greater than the date informed or the limit
instagramNodeApi.usersMediaRecent(userId, 1000); // => Stop the search when the number of founded medias is greater than the limit informed

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
UID_MEDIA_TEST=1482874536541873956_1645525258

And just run npm test

Contributing

Currently this is very basic for my needs, PRs are welcome ๐Ÿ™

About

BETA - A node wrapper to Instagram API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published