Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/notslang/instagram-scrape-account-stats
https://github.com/notslang/instagram-scrape-account-stats
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/notslang/instagram-scrape-account-stats
- Owner: notslang
- License: gpl-3.0
- Created: 2015-07-24T15:58:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-05T19:24:10.000Z (almost 7 years ago)
- Last Synced: 2024-12-27T17:23:49.967Z (about 1 month ago)
- Language: CoffeeScript
- Homepage: https://npmjs.com/package/instagram-scrape-account-stats
- Size: 17.6 KB
- Stars: 11
- Watchers: 5
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Instagram Scrape Account Stats
[![Build Status](http://img.shields.io/travis/slang800/instagram-scrape-account-stats.svg?style=flat-square)](https://travis-ci.org/slang800/instagram-scrape-account-stats) [![NPM version](http://img.shields.io/npm/v/instagram-scrape-account-stats.svg?style=flat-square)](https://www.npmjs.org/package/instagram-scrape-account-stats) [![NPM license](http://img.shields.io/npm/l/instagram-scrape-account-stats.svg?style=flat-square)](https://www.npmjs.org/package/instagram-scrape-account-stats)
A tool for scraping public data from Instagram, without needing to get permission from Instagram. It scrapes the following fields:
- description
- followers
- following
- isExplicit
- isPrivate
- isVerified
- name
- posts
- userId
- username
- websiteSee `lib/response.schema.json` for further details.
## Example
### CLI
The CLI operates entirely over STDOUT, and will output the account stats as JSON.
```bash
$ instagram-scrape-account-stats -u slang800
{"description":null,"followers":21,"following":90,"isExplicit":false,"isPrivate":false,"isVerified":false,"name":"Sean Lang","userId":"465981344","username":"slang800","posts":2,"website":"http://slang.cx"}
```### JavaScript Module
The following example is in CoffeeScript.
```coffee
{getAccountStats} = require 'instagram-scrape-account-stats'getAccountStats(username: 'slang800').then((account) ->
console.log "#{account.username} has #{account.followers} followers."
)
```The following example is the same as the last one, but in JavaScript.
```javascript
var getAccountStats = require('instagram-scrape-account-stats').getAccountStats;getAccountStats({username: 'slang800'}).then(function(account) {
console.log(account.username + " has " + account.followers + " followers.");
});
```## Why?
Instagram doesn't provide an open, structured, and machine readable API, so, we're forced to scrape their user-facing site.
## Caveats
- This is probably against the Instagram TOS, so don't use it if that sort of thing worries you.
- Whenever Instagram updates certain parts of their front-end this scraper will need to be updated to support the new API.
- You can't scrape protected accounts (cause it's not public duh).