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

instagram-client

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

instagram-client

Instagram API client for node, supports both promises and callbacks

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Instagram node client

codecov Build Status

Get started

Add instagram-client to your project

npm i instagram-client

Use the instagram client

const Instagram = require("instagram-client").v1
const Client = new Instagram({
    CLIENT_ID: process.env.CLIENT_ID,
    CLIENT_SECRET: process.env.CLIENT_SECRET,
})

API

Classes

CommentsEndpoint

Client.comments

// example
Client.comments.create("MEDIAID", {
 text: "some comment",
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})
LikesEndpoint

Client.likes

// example
Client.likes.getByMedia("MEDIAID", {
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})
LocationsEndpoint

Client.locations

// example
Client.locations.getByID("LOCATIONID", {
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})
MediaEndpoint

Client.media

// example
Client.media.getByID("SOMEMEDIAID", {
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})
OAuthEndpoint

Client.oauth

// example
Client.oauth.getAccessToken({
 grantType: "",
 redirectURI: "",
 code: "",
})
.then(result => {})
SubscriptionsEndpoint

Client.subscriptions

// example
Client.subscriptions.create({
 object: "",
 aspect: "",
 verifyToken: "",
 callbackURL: "",
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})
TagsEndpoint

Client.tags

// example
Client.tags.getByName("travel", {
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})
UsersEndpoint

Client.users

// example
Client.users.getSelf({
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})
V1InstagramClient

InstagramClient V1

const Instagram = require("instragram-client").v1


const Client = new Instagram({
CLIENT_ID: "SOMECLIENTID",
CLIENT_SECRET: "SOMECLIENTSECRET",
})

const Client = new Instagram({ CLIENT_ID: "SOMECLIENTID", CLIENT_SECRET: "SOMECLIENTSECRET", })

Comments ⇐ Endpoint

Client.comments

// example
Client.comments.create("MEDIAID", {
 text: "some comment",
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})

Kind: global class
Extends: Endpoint

comments.create(id, opts, cb)

Creates a comment for a media by media id

Kind: instance method of Comments

ParamTypeDescription
idstringthe media ID
optsobjectthe options object { accessToken, sign, text }
cbfunctioncallback called if paseed, otherwise returns a promise

comments.del(id, opts, cb)

Deletes a comment for a media by media id

Kind: instance method of Comments

ParamTypeDescription
idstringthe media ID
optsobjectthe options object { accessToken, sign, text }
cbfunctioncallback called if paseed, otherwise returns a promise

comments.getByMediaID(id, opts, cb)

Get comments for a media by media id

Kind: instance method of Comments

ParamTypeDescription
idstringthe media ID
optsobjectthe options object { accessToken, sign, text }
cbfunctioncallback called if paseed, otherwise returns a promise

Likes ⇐ Endpoint

Client.likes

// example
Client.likes.getByMedia("MEDIAID", {
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})

Kind: global class
Extends: Endpoint

likes.getByMedia(id, opts, cb)

Gets likes for a media by media id

Kind: instance method of Likes

ParamTypeDescription
idstringthe media ID
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

likes.likeMedia(id, opts, cb)

Like a media by media id with user from accessToken

Kind: instance method of Likes

ParamTypeDescription
idstringthe media ID
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

likes.unlikeMedia(id, opts, cb)

Unlike a media by media id with user from accessToken

Kind: instance method of Likes

ParamTypeDescription
idstringthe media ID
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

Locations ⇐ Endpoint

Client.locations

// example
Client.locations.getByID("LOCATIONID", {
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})

Kind: global class
Extends: Endpoint

locations.getByID(id, opts, cb)

Gets a location by id

Kind: instance method of Locations

ParamTypeDescription
idstringthe location ID
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

locations.getMediaRecent(id, opts, cb)

Gets recent media for location by location id

Kind: instance method of Locations

ParamTypeDescription
idstringthe location ID
optsobjectthe options object { accessToken, sign, maxTagID, minTagID }
cbfunctioncallback called if paseed, otherwise returns a promise

locations.search(opts, cb)

Search locations

Kind: instance method of Locations

ParamTypeDescription
optsobjectthe options object { accessToken, sign, lat, lng, facebookPlacesID }
cbfunctioncallback called if paseed, otherwise returns a promise

Media ⇐ Endpoint

Client.media

// example
Client.media.getByID("SOMEMEDIAID", {
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})

Kind: global class
Extends: Endpoint

media.getByID(id, opts, cb)

Gets a media by id

Kind: instance method of Media

ParamTypeDescription
idstringthe media ID
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

media.getByShortcode(id, opts, cb)

Gets a media by shortcode

Kind: instance method of Media

ParamTypeDescription
idstringthe media shortcode
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

media.search(id, opts, cb)

Search media by locations

Kind: instance method of Media

ParamTypeDescription
idstringthe media shortcode
optsobjectthe options object { accessToken, sign, lng, lat, distance }
cbfunctioncallback called if paseed, otherwise returns a promise

OAuth ⇐ Endpoint

Client.oauth

// example
Client.oauth.getAccessToken({
 grantType: "",
 redirectURI: "",
 code: "",
})
.then(result => {})

Kind: global class
Extends: Endpoint

oAuth.getAccessToken(opts, cb)

It returns the accessToken

Kind: instance method of OAuth

ParamTypeDescription
optsobjectthe options object { code, grantType, redirectURI }
cbfunctioncallback called if paseed, otherwise returns a promise

oAuth.getAuthURL(opts)

It returns the authURL

Kind: instance method of OAuth

ParamTypeDescription
optsobjectthe options object { CLIENT_ID, CLIENT_SECRET, responseType, redirectURI, scope }

Subscriptions ⇐ Endpoint

Client.subscriptions

// example
Client.subscriptions.create({
 object: "",
 aspect: "",
 verifyToken: "",
 callbackURL: "",
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})

Kind: global class
Extends: Endpoint

subscriptions.create(opts, cb)

Creates a subscription

Kind: instance method of Subscriptions

ParamTypeDescription
optsobjectthe options object { accessToken, sign, object, aspect, verifyToken, callbackURL }
cbfunctioncallback called if paseed, otherwise returns a promise

subscriptions.list(opts, cb)

Lists the subscriptions for the client

Kind: instance method of Subscriptions

ParamTypeDescription
optsobjectthe options object { accessToken, sign, object, aspect, verifyToken, callbackURL }
cbfunctioncallback called if paseed, otherwise returns a promise

subscriptions.del(opts, cb)

Deletes subscriptions for the client

Kind: instance method of Subscriptions

ParamTypeDescription
optsobjectthe options object { accessToken, sign, object, aspect, verifyToken, callbackURL }
cbfunctioncallback called if paseed, otherwise returns a promise

Tags ⇐ Endpoint

Client.tags

// example
Client.tags.getByName("travel", {
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})

Kind: global class
Extends: Endpoint

tags.getByName(tagName, opts, cb)

Gets a tag by name

Kind: instance method of Tags

ParamTypeDescription
tagNamestringthe tag name
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

tags.getMediaRecent(tagName, opts, cb)

Gets a tag's recent media by tag name

Kind: instance method of Tags

ParamTypeDescription
tagNamestringthe tag name
optsobjectthe options object { accessToken, sign, minTagID, maxTaxID, count }
cbfunctioncallback called if paseed, otherwise returns a promise

tags.search(tagName, opts, cb)

Searches a tag by tag name

Kind: instance method of Tags

ParamTypeDescription
tagNamestringthe tag name
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

Users ⇐ Endpoint

Client.users

// example
Client.users.getSelf({
 accessToken: "SOMEACCESSTOKEN",
})
.then(result => {})

Kind: global class
Extends: Endpoint

users.getSelf(opts, cb)

Gets the user from the access token

Kind: instance method of Users

ParamTypeDescription
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

users.getSelfFollows(opts, cb)

Gets the users followed by the user from the access token

Kind: instance method of Users

ParamTypeDescription
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

users.getSelfFollowedBy(opts, cb)

Gets the user's follower of the user from the access token

Kind: instance method of Users

ParamTypeDescription
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

users.getSelfRequestedBy(opts, cb)

Gets the pending follow requests of the user from the access token

Kind: instance method of Users

ParamTypeDescription
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

users.getRelationshipWithUser(id, opts, cb)

Gets the relationship between a user and the user from the access token

Kind: instance method of Users

ParamTypeDescription
idstringthe ID of the user to check the relatioship with the accessToken user
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

users.updateRelationshipWithUser(id, opts, cb)

Updates the relationship between a user and the user from the access token

Kind: instance method of Users

ParamTypeDescription
idstringthe ID of the user to check the relatioship with the accessToken user
optsobjectthe options object { accessToken, sign, action }
cbfunctioncallback called if paseed, otherwise returns a promise

users.getByID(id, opts, cb)

Gets a user by ID

Kind: instance method of Users

ParamTypeDescription
idstringthe ID of the user to get
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

users.getUserRecentMedia(id, opts, cb)

Gets a user's recent media by user ID

Kind: instance method of Users

ParamTypeDescription
idstringthe ID of the user to get
optsobjectthe options object { accessToken, sign, count }
cbfunctioncallback called if paseed, otherwise returns a promise

users.getSelfRecentMedia(opts, cb)

Gets a self recent media from the accessToken

Kind: instance method of Users

ParamTypeDescription
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

users.getSelfMediaLiked(opts, cb)

Gets a self media liked from the accessToken

Kind: instance method of Users

ParamTypeDescription
optsobjectthe options object { accessToken, sign }
cbfunctioncallback called if paseed, otherwise returns a promise

users.search(opts, cb)

Search a users

Kind: instance method of Users

ParamTypeDescription
optsobjectthe options object { accessToken, sign, q }
cbfunctioncallback called if paseed, otherwise returns a promise

V1 ⇐ InstagramClient

InstagramClient V1

const Instagram = require("instragram-client").v1

const Client = new Instagram({
 CLIENT_ID: "SOMECLIENTID",
 CLIENT_SECRET: "SOMECLIENTSECRET",
}) 

Kind: global class
Extends: InstagramClient

new V1(opts)

ParamTypeDescription
optsobjectthe options object { CLIENT_ID, CLIENT_SECRET }

v1.get(endpoint, opts, cb)

Kind: instance method of V1

ParamType
endpointstring
optsobject
cbfunction

v1.post(endpoint, opts, formData, cb)

Kind: instance method of V1

ParamType
endpointstring
optsobject
formDataobject
cbfunction

v1.del(endpoint, opts, formData, cb)

Kind: instance method of V1

ParamType
endpointstring
optsobject
formDataobject
cbfunction

FAQs

Package last updated on 26 Nov 2017

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