npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pjwebco-instagram-graph-api

v3.9.4

Published

This repository contains a set of functions to interact with the Instagram Graph API. These functions allow you to retrieve information about Instagram users, media, reels, TV series, and TV videos. The code is organized into separate modules for each Ins

Downloads

24

Readme

Certainly! Here's a sample README.md file with documentation for all the generated files:

# Instagram API Documentation

This repository contains a set of functions to interact with the Instagram Graph API. These functions allow you to retrieve information about Instagram users, media, reels, TV series, and TV videos. The code is organized into separate modules for each Instagram feature.

### Configuration

The API Configuration module provides an instance of the `APIConfig` class, which includes the following configuration properties:

- `baseURL` (string): The base URL for API requests.
- `accessToken` (string): The user's access token.

You can set the API configuration by calling the `setConfig` method with either a new configuration object or an access token string. If you provide a configuration object, you can specify the `accessToken` and `baseURL` properties.

```javascript
// Set the library configuration with an access token
API.setConfig("your-access-token");

// Set the library configuration with a new base URL and access token
API.setConfig({
  accessToken: "your-access-token",
  baseURL: "https://new-api-url.com",
});
```

Instagram User Functions (user.ts)

getUserInfo(username: string): Promise<object>

This function retrieves information about a specific Instagram user.

  • username (string): The username of the user to retrieve information for.
  • Returns a Promise that resolves to the user's data.
  • Throws an error if the request fails or if "user" permission is required.

searchUsers(query: string): Promise<object>

This function allows you to search for Instagram users by name or username.

  • query (string): The search query.
  • Returns a Promise that resolves to the search results.
  • Throws an error if the request fails or if "user" permission is required.

getUserFollowers(userId: string): Promise<object>

This function retrieves a list of users who follow a specific Instagram user.

  • userId (string): The ID of the user to retrieve followers for.
  • Returns a Promise that resolves to the followers data.
  • Throws an error if the request fails or if "followers" permission is required.

getUserFollowing(userId: string): Promise<object>

This function retrieves a list of users that a specific Instagram user is following.

  • userId (string): The ID of the user to retrieve following for.
  • Returns a Promise that resolves to the following data.
  • Throws an error if the request fails or if "following" permission is required.

Instagram Media Functions (media.ts)

getMediaInfo(mediaId: string): Promise<object>

This function retrieves information about a specific Instagram media object.

  • mediaId (string): The ID of the media object to retrieve.
  • Returns a Promise that resolves to the media object's data.
  • Throws an error if the request fails.

searchMediaByHashtag(hashtag: string): Promise<object>

This function allows you to search for Instagram media objects by hashtag.

  • hashtag (string): The hashtag to search for.
  • Returns a Promise that resolves to the search results.
  • Throws an error if the request fails.

getCommentInfo(commentId: string): Promise<object>

This function retrieves information about a specific Instagram comment.

  • commentId (string): The ID of the comment to retrieve.
  • Returns a Promise that resolves to the comment data.
  • Throws an error if the request fails.

searchCommentsOnMedia(mediaId: string): Promise<object>

This function allows you to search for comments on a specific media object by media ID.

  • mediaId (string): The ID of the media object to search for comments on.
  • Returns a Promise that resolves to the comments data.
  • Throws an error if the request fails.

getUserMedia(username: string, options?: number | GetUserMediaOptions): Promise<object>

This function fetches a user's media by username with optional media type and limit.

  • username (string): Instagram username.
  • options (number | GetUserMediaOptions): Optional parameters for media type and limit.
  • Returns a Promise that resolves to the user's media data.
  • Throws an error if the request fails.

getMediaLikes(mediaId: string): Promise<object>

This function retrieves a list of users who have liked a specific Instagram media object.

  • mediaId (string): The ID of the media object to retrieve likes for.
  • Returns a Promise that resolves to the likes data.
  • Throws an error if the request fails.

getMediaComments(mediaId: string): Promise<object>

This function retrieves a list of comments on a specific Instagram media object.

  • mediaId (string): The ID of the media object to retrieve comments for.
  • Returns a Promise that resolves to the comments data.
  • Throws an error if the request fails.

Instagram Reels Functions (reels.ts)

getReelInfo(reelId: string): Promise<object>

This function retrieves information about a specific Instagram Reel.

  • reelId (string): The ID of the Reel to retrieve.
  • Returns a Promise that resolves to the Reel data.
  • Throws an error if the request fails.

searchReels(query: string): Promise<object>

This function allows you to search for Instagram Reels.

  • query (string): The search query.
  • Returns a Promise that resolves to the search results.
  • Throws an error if the request fails.

getMentions(username: string): Promise<object>

This function retrieves a list of comments that mention a specific Instagram user.

  • username (string): The Instagram username to search for mentions.
  • Returns a Promise that resolves to the mention data.
  • Throws an error if the request fails.

Instagram TV Functions (tv.ts)

getTvSeriesInfo(seriesId: string): Promise<object>

This function retrieves information about a specific Instagram TV series.

  • seriesId (string): The ID of the TV series to retrieve.
  • Returns a Promise that resolves to the TV series data.
  • Throws an error if the request fails.

searchTvSeries(query: string): Promise<object>

This function allows you to search for Instagram TV series.

  • query (string): The search query.
  • Returns a Promise that resolves to the search results.
  • Throws an error if the request fails.

getTvVideoInfo(videoId: string): Promise<object>

This function retrieves information about a specific Instagram TV video.

  • videoId (string): The ID of the TV video to retrieve.
  • Returns a Promise that resolves to the TV video data.
  • Throws an error if the request fails.

searchTvVideos(query: string): Promise<object>

This function allows you to search for Instagram TV videos.

  • query (string): The search query.
  • Returns a Promise that resolves to the search results.
  • Throws an error if the request fails.

License

This code is provided under the MIT license.


You can use this `README.md` as a starting point and modify it as needed to suit your project's specific requirements.