A node wrapper to Instagram API
npm install instagram-node-apiBETA - A node wrapper to Instagram API 😄
Another's coming soon.
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) => { });
`
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`