Integrate Instagram Without API + Drupal 8


It's a very simple module that integrates without an API with Instagram and generates a block that contains your latest Instagram messages.

To submit bug reports and feature suggestions, or to track changes:

Install as you would normally install a contributed Drupal module. See:
for further information.

To add Instagram Block to specific content region Go to Block Layout.
i.e Home-> Administration-> Structure-> Block layout.

You must also add the Instagram account user name as part of the block setup to pull posts.



Steps to Instagram Authentication Code Generation

1 - Instagram Register Application: 
 To register a new app, visit https:/

2 - Register New App Client:
  Go to Manage Clients, and hit 'Register a New Client' to register and access the API

3 - Copy & Save Client ID:
  Here you will soon need the Client ID to copy the Client ID.

4 - Configure Client for Public Access:
 From the Manage Clients screen, click ' Edit ' on your app, then open the ' Security ' tab and uncheck the ' Disable Implicit OAuth ' as we would like to see our feed from the public. Additionally, open the ' Sandbox ' tab and confirm this app's ' admin '. 

5 - Use this API URL in a browser:
 You can use your browser's easy URL to capture your access token. Open your browser and paste the URL below, replace the string after ' client I d ' and before your previously saved Client ID, and press Enter to visit this URL:

6 - Get Code:
  Now, you're getting the code. Just save the code to be used in the future.

6 - Authorize it:
 Visiting the URL we made with the client ID will create an ' Authorize ' screen. At this stage, you are using your local server to simulate an API link and you will authorize it to view the Access Token reply. Click "Authorize"

7 - Get Access token:
  data in the URL… right after '#access_token=' you can grab your public Access Token, which also has your ID in it.
  The User ID is the first string of digits before the first point(.)
  user id: 75XXXXXX51



-> From my experience, the Instagram access token expires at random moments. Even though our access tokens do not indicate an expiration time, your software should manage the event that either the user revokes access, or Instagram expires the token after a certain period of time. If the token is no longer valid, the replies to the API will contain "error type= OAuthAccessTokenError." In this case, you will need to re-authenticate the user to get a fresh valid token.

-> Every moment we need to regenerate the Authentication token, authorize the Instagram account and put it on our live server. We don't understand that the Instagram access token's time interval expires.

-> We can retrieve the data using query I d &?a=1 procedure (returns user account data-first set-in JSON format 'https:/{user}/? a=1'). I mentioned that query I d is a continuous value. That implies it is always 17888483320059182. Query I d' is now static, just use it (at least unless Instagram changes it).

-> Take the Instagram media request InstagramWithoutAPI:
If Instagram has altered the way it provides this information, none of the above techniques will operate. So, I decided to get the Instagram image information from the https:/{user}/ route. This technique returns all user account associated pictures.

-> So we get the information from instagram without an API.  (



Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
1 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.