Skip to content

felipeinf/instagranode

Repository files navigation

instagranode

TypeScript SDK for Node.js (18+) that calls Instagram’s unofficial web API endpoint web_profile_info using browser-like headers.

Public profiles. The flow this library uses targets publicly visible profile data exposed by Instagram’s web client. It does not require Instagram user authentication (no login, no OAuth access token, no session cookies). That also means behavior for private accounts is limited to what the endpoint returns without a logged-in viewer (for example, follower counts may appear while post media may not).

Not an official product. instagranode is not an official product, has no relationship with Meta, and is not affiliated with Instagram. You are solely responsible for your use of this library. It was not created with commercial use in mind and is not a commercial product, is not offered for sale, and is not intended as a substitute for any official Instagram tooling.

Install

npm install instagranode

Quick start

import { InstagraNode } from "instagranode";

const ig = new InstagraNode({ browser: "chrome-mac" });
const profile = await ig.searchProfile("google");

console.log(profile.id, profile.followerCount, profile.isPrivate);
console.log(profile.mentions(), profile.links());
console.log(profile.address(), profile.business());
console.log(profile.hasVisibleMedia());

await profile.downloadProfilePic("./avatar.jpg");

Sandbox (no network)

export INSTAGRANODE_SANDBOX=true

Or:

const ig = new InstagraNode({ sandbox: true });

Fixture usernames: sandbox_influencer, sandbox_business, sandbox_private, sandbox_private_media. Any other username resolves to sandbox_influencer data with the requested username string.

Errors

All SDK errors extend InstagraNodeError with code and recoverable. Handle ProfileNotFoundError, IncompleteProfileError, RateLimitedError, BlockedError, NetworkError, and CircuitOpenError as needed.

Docs

See the docs/ folder on GitHub: getting-started.md, profiles.md, download.md, examples.md.

License

MIT: you may use, modify, and redistribute the code freely; the license includes a standard “as is” warranty disclaimer. The full text is in LICENSE. The separate Legal disclaimer at the end of this file also applies.

Legal disclaimer

What this is. The following is a general informational disclaimer about the software and the project. It is not tailored to your situation or jurisdiction and does not create an attorney–client relationship.

This notice is written with U.S. law in mind; your rights and duties may differ elsewhere.

instagranode is not affiliated with, endorsed by, maintained by, or sponsored by Meta Platforms, Inc., Instagram, or their affiliates. Instagram is a trademark of Meta Platforms, Inc.

The software is provided “AS IS” and “AS AVAILABLE”, without warranties of any kind, whether express or implied, including implied warranties of merchantability, fitness for a particular purpose, and non-infringement. Your use is at your sole risk. To the fullest extent permitted by law, the authors and contributors disclaim liability for any direct, indirect, incidental, special, consequential, or exemplary damages, and for any loss of data, account access, goodwill, or other intangible losses, arising out of or related to your use or inability to use this software—including claims arising from violation of Instagram’s terms, policies, or applicable law, or from misuse by you or third parties.

The project exists for personal learning and experimentation only. You are solely responsible for compliance with Instagram’s terms and all laws that apply to you. The maintainers do not encourage or support unlawful, abusive, or harmful use.

The above is for general information only. It is not legal advice.

About

TypeScript SDK that calls Instagram’s unofficial web API.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors