👉 DEPRECATED! THIS COMPONENT NO LONGER WORKS 👈
After its acquisition of Instagram, Facebook made changes to how the Instagram API is accessed.
Vue Instagram Feed
Getting Started
Prerequisites
- A polyfill for the Fetch API if you have to support old browsers: https://caniuse.com/#search=fetch
- Vue 2.6 or greater
Install
In a project created with vue-cli
# npm npm i vue-instagram-feed
# yarn yarn add vue-instagram-feed
Without using build tools
Example
See it on codepen: https://codepen.io/mornir0/pen/MMabbw
{{ post.caption.text }} #{{ tag }} {{ errorMsg }} More
API
Props
Prop | Description | Default Value |
---|---|---|
token | A string code (see below) | none |
count | Number of posts to load per request | 2 |
Slot Props
Prop | Description |
---|---|
posts | The object response from the Instagram API |
fetchMorePosts | A method to fetch more posts |
errorMsg | An error message |
areMorePages | A boolean indicating if there are more posts to be fetched |
Access Token
How to get the token
- Open this URL in an incognito tab: https://instagram.pixelunion.net/
- Click
Generate Access Token
to get the token
Note: The targeted Instagram account must be public and personal. (Business acounts use the Instagram Graph API)
Security Notice
The generated access token only provides read
access to the Instagram account.
Therefore, there is no need to keep it private. By the way, public Instragram feeds can also be easily scrapped.
Token can be revoked at any times in the Instagram account settings page.