Crate instagram_scraper_rs

Source
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;

Structs§

Comment
Comment associated to a post
InstagramScraper
instagram scraper client
Post
User post
Stories
Instagram stories
Story
StorySource
User
Describes the web profile query response

Enums§

InstagramScraperError
Instagram scraper library error

Type Aliases§

InstagramScraperResult