Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graph-ig

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graph-ig

Instagram Graph API client

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

graph-ig

npm version License: MIT

graph-ig helps you interact with the Instagram Graph API easily and efficiently. The library is still under development and not yet stable.

Table of Contents

Installation

To install graph-ig, run the following command:

npm install graph-ig

Usage

Creating an API client

The InstagramGraphAPI class is the main interface for interacting with the Instagram Graph API. The configuration object should include an access token, a base URL, and a debug flag (optional). The access token is required to authenticate with the Instagram Graph API. If no base URL is provided, the default will be https://graph.facebook.com/v16.0. The debug flag, if set to true, will enable logging of request and response information.

import { InstagramGraphAPI } from 'graph-ig'

const ig = new InstagramGraphAPI({
  accessToken: 'your-access-token',
  baseUrl: 'https://graph.facebook.com/v16.0',
  debug: true
})

Fetching a comment by ID

To fetch a comment by its ID, use the getCommentById method. You can also provide an array of fields to include in the response.

const commentId = 123456789
const fields = ['text', 'username']

ig.getCommentById({ commentId, fields })
  .then((comment) => {
    console.log(comment)
  })
  .catch((error) => {
    console.error('Error fetching comment:', error)
  })

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests on GitHub.

License

graph-ig is licensed under the MIT License.

Keywords

FAQs

Package last updated on 29 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc