InstAPI

Provides abstractions over the Instagram Basic Display API to retrieve tokens and gather user's profile information and media.

Example usage

```rust use instapi::{auth, user};

let secrets = auth::Secrets { appid: /* Instagram app ID */, appsecret: /* Instagram app secret /, oauth_uri: / OAuth redirect URI */, };

// Forward the user to the authorization page and interactively request a code. let code = auth::requestcode(&secrets)?; // Exchange the authorization code for a short-lived token. let token = auth::ShortLivedToken::new(&secrets, code.asstr())?;

// Link the token with profile. let profile = user::Profile::new(token); // Retrieve the user profile information and print username. println!("Username: {}", profile.info()?.username()); ```

Modules description

Instafetcher

An example utility that provides command-line interface for the library.

To build this tool you need to set INSTAGRAM_APP_ID, INSTAGRAM_APP_SECRET and INSTAGRAM_OAUTH_URI environment variable with the corresponding values. To perform authorization use --log-in option, that will store a long-lived token in the system's configuration directory. After that you can use the following main options: - --info. Retrieve and display the basic profile information. - --media. Download all media files to the given directory. File names have the following format: <owner's username>_<media ID>_<publish date>. For each album will be created a subdirectory. To exclude albums use --no-albums option.