![]() In the event of an error, Instafeed will return an error message. The number of seconds until the long-lived User Access Token expires.īasic Display API Reference for refresh_access_token endpoint Errors The value is always 'bearer', I'm not sure what this is for. The original token is still valid, despite the API returning a different one here. PropertyĪ long-lived Instagram User Access Token. The refreshToken() function will return the following values if the request was successful. OptionĪ valid long-lived User Access Token that has not expired. The refreshToken() function accepts an object of options as it's only parameter. The refreshToken() function makes a request to the /refresh_access_token endpoint of the Instagram Graph API. See the Basic Display API Reference for Media for a definitive reference to the data returned for each Instagram post. Note: instafeed() returns the post objects exactly as they are received from the API, but adds an image property to each post so you have a reliable URL to an image for the post regardless of the media_type. Depending the media_type, this will either be the media_url or thumbnail_url. This is a property added by the instafeed() function. If the post has no caption, the API does not return this. The thumbnail image URL, this is only returned if the media_type is VIDEO. If the media_type is VIDEO, this will be a link to a video file. If the media_type is IMAGE or CAROUSEL_ALBUM, this will be a link to an image. The username of the account that made the post. You can pass this value to request the next set of posts.Įach Instagram post object will contain the following properties. ![]() The 'after' page cursor returned from the API. The table below lists all properties attached to each Instagram post object.Ī count of the total number of posts the API returned. The instafeed() function will return the following values if the request was successful. More Information on Cursor-Based Pagination.By passing an 'after' page cursor, you're telling the API to return posts that come after the last post returned in a previous request. An error will be thrown if you attempt to request more than 25 posts.Īn 'after' page cursor from a previous request that points to the end of the 'page' of data that was returned. The number of posts you want to fetch, the default value is 25, and the API will only return a maximum of 25 posts per request. OptionĪ long-lived User Access Token for the Instagram account you want to fetch the posts for. The instafeed() function accepts an object of options as it's only parameter. The instafeed() function makes a request to the /me/media endpoint of the Instagram Graph API. Number of seconds until the User Access Token Expires Npm install instafeed-node-js Basic Usage // Require ModuleĬonst ) Please be sure to update this value in the code snippets to correctly reference the variable for your User Access Token. Therefore, the code snippets below assume your User Access Token is stored in _user_access_token. Note: It is highly recommended that you store User Access Tokens in an environment variable. A User Access Token will allow you to fetch only the Instagram posts from the account it was generated for.įor more information about how to obtain a User Access Token, see: Basic Display API Overview Table of Contents To use this module, it is recommended that you obtain a long-lived User Access Token from the User Token Generator tool in the Facebook Developers Console. ![]() This node.js module allows you to asynchronously fetch posts from the Instagram Graph API with a long-lived User Access Token.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |