Expand description

Instagram-scraper-rs

instagram-scraper-rs is a Rust library that scrapes and downloads an instagram user’s photos and videos. Use responsibly. It is basically a 1:1 copy of the Python Instagram-scraper cli application.

Features

  • Query profile information
  • Collect the user’s profile picture
  • Collect users’ posts
  • Collect users’ stories
  • Totally async

Get started

Add instagram-scraper-rs to your Cargo.toml 🦀

instagram-scraper-rs = "^0.1.0"

Supported features are:

  • no-log: disable logging
  • native-tls (default): use native-tls for reqwest
  • rustls: use rustls for reqwest (you must disable default features)

Instagram scraper setup

use instagram_scraper_rs::InstagramScraper;

// setup the scraper
let mut scraper = InstagramScraper::default()
    .authenticate_with_login(username, password);
scraper.login().await?;
// get user info; required to query other data
let user = scraper.scrape_userinfo("tamadogecoin").await?;
// collect user's stories and up to 10 highlighted stories
let stories = scraper.scrape_user_stories(&user.id, 10).await?;
// collect last 10 posts
let posts = scraper.scrape_posts(&user.id, 10).await?;
// logout
scraper.logout().await;
Run

Structs

Comment associated to a post

instagram scraper client

User post

Instagram stories

Describes the web profile query response

Enums

Instagram scraper library error

Type Definitions