A JavaScript library to make requests to Instagram
Contents
Installation
$ yarn add shitgram
Example
const Shitgram = ; const shitgram = ; shitgram ;
Documentation
Constructor
new Shitgram(credentials) ⇒credentials
: Object (Optional)username
Instagram account usernamepassword
Instagram account passwordsessionID
An instagram session id. Will be used if you have not setusername
andpassword
.
You will not need to set a session id if you have already set username and password.
Promise
getSessionID ⇒Generate a new session id or return a defined sessionID
If username and password are set, a new session id will always be generated. So that a unique session id will be returned set property sessionID in the credentials.
It is possible to get the session ID without the builder by using plug-in.
Returns: Promise — Returned promise
Promise
getUserDataWithSession(params) ⇒Get user data that is only available with a session id
Returns: Promise — Returned promise
Promise
getUserStoriesWithSession(params) ⇒Get user stories that is only available with a session id
Returns: Promise — Returned promise
Promise
getUserHighlightsWithSession(params) ⇒Get user highlight that is only available with a session id
Returns: Promise — Returned promise
Promise
user(param, options) ⇒Get user details
param
: String (Required)
Username
orlink
for the user profile you want details aboutoptions
: Object (Optional)defaultResponse
Settrue
to return instagram default response,false
is set to default.
Returns: Promise — Returned promise
Promise
story(param, options) ⇒Get story details
param
: String (Required)
Username
orlink
for the user stories you want details aboutoptions
: Object (Optional)defaultResponse
Settrue
to return default response from storiesig.com or if you have set credentials the response will be from instagram.com,false
is set to default.exclude
The file type to exclude from the response, will not exclude if defaultResponse istrue
.
Returns: Promise — Returned promise
Promise
highlight(param, options) ⇒Get highlight details
param
: String (Required)
Highlight id
orlink
to itoptions
: Object (Optional)defaultResponse
Settrue
to return instagram default response,false
is set to default.exclude
The file type to exclude from the response, will not exclude if defaultResponse istrue
.
Highlights will be returned if they have been set by the author to be shared, check availability of highlights in the canReshare
property; if null, highlights will be an empty array.
Returns: Promise — Returned promise
Promise
image(param, options) ⇒Get image post details
param
: String (Required)
Post code
orlink
to itoptions
: Object (Optional)defaultResponse
Settrue
to return instagram default response,false
is set to default.
Returns: Promise — Returned promise
Promise
video(param, options) ⇒Get video post details
param
: String (Required)
Post code
orlink
to itoptions
: Object (Optional)defaultResponse
Settrue
to return instagram default response,false
is set to default.
Returns: Promise — Returned promise
Promise
album(param, options) ⇒Get album post details
param
: String (Required)
Albumpost code
orlink
to itoptions
: Object (Optional)defaultResponse
Settrue
to return instagram default response,false
is set to default.exclude
The file type to exclude from the response, will not exclude if defaultResponse istrue
.
Returns: Promise — Returned promise
String>
ExcludeType : enum<File type to exclude from response
Available properties: IMAGE
- VIDEO
Plugins
Promise
Session(params) ⇒Generate a new csrfToken and sessionID from Instagram username and password
params
A brief example of use here
Returns: Promise — Returned promise