instagram-posts

2.2.0 • Public • Published

instagram-posts Build Status

Get Instagram posts from a user

Install

$ npm install instagram-posts

Usage

const instagramPosts = require('instagram-posts');
 
(async () => {
    console.log(await instagramPosts('cats_of_instagram'));
    /*
    [
        {
            id: 'BRWBBbXjT40',
            username: 'cats_of_instagram',
            time: 1488904930,
            type: 'image',
            likes: 809,
            comments: 10,
            text: 'This is my post',
            media: 'https://instagram.fbma1-1.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/1231231_123123_1231231.jpg',
            …
        },
        …
    ]
    */
})();

API

instagramPosts(username, options?)

Returns a Promise<Object[]> with the users posts.

username

Type: string

Username to fetch posts from.

options

Type: Object

count

Type: number
Default: 20

Number of posts to fetch.

filter

Type: Function

Custom function to filter out posts, e.g:

instagramPosts('cats_of_instagram', {
    filter: data => data.likes > 500
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.2.0
    44
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.2.0
    44
  • 2.1.0
    0
  • 2.0.0
    1
  • 1.0.1
    8
  • 1.0.0
    2

Package Sidebar

Install

npm i instagram-posts

Weekly Downloads

55

Version

2.2.0

License

MIT

Unpacked Size

4.91 kB

Total Files

4

Last publish

Collaborators

  • kevva