Instagram Graph API Access Tokens with Python

Поделиться
HTML-код
  • Опубликовано: 29 окт 2024

Комментарии • 81

  • @enversdudecor
    @enversdudecor 4 года назад +19

    For those who ask :
    Permissions
    The manage_pages permission has been deprecated and replaced with 4 new permissions:
    pages_manage_ads
    pages_manage_metadata
    pages_read_engagement
    pages_read_user_content

  • @akuamtau
    @akuamtau 4 года назад +4

    Great content. The APIs change a lot really quickly so this type of content is seriously helpful

  • @AmanSingh-kp5zw
    @AmanSingh-kp5zw 4 года назад +11

    Currently , there is no permission such as manage_pages in the API, we do have manage_pages_metadata, are both they same?

    • @muhammedjaabir2609
      @muhammedjaabir2609 4 года назад +3

      read the doc , they recently changed the publish_posts and and manage_pages to 6 new different permissions so you should add all those

  • @moosatov
    @moosatov 4 года назад +2

    Great straight-forward tutorial! Thank you. Wouldn't be able to accomplish it without this.

  • @tarunalakhramsing7861
    @tarunalakhramsing7861 4 года назад +3

    The content here is Amazing!
    Suprised The Likes Are So Little

  • @emscherblues
    @emscherblues 2 года назад +1

    I tried to follow this, but ran into errors. When I just followed the tutorial, but also when cloning the complete code from github. Not sure if make any mistakes or there were changes after more than two years and the code itself needed some changes. Except from my personal token, ID and secret of course.

  • @OnurKapucu
    @OnurKapucu Год назад +1

    Great content. Thanks!

  • @jajupmochi
    @jajupmochi 7 месяцев назад

    Thank you! This is super useful! Still work in 2024!

  • @yueedwards1
    @yueedwards1 6 месяцев назад

    Thanks for creating this video! do i understand it correctly that this approach only works for accessing your own fb/ig accounts' data? i am trying to get all ig business accounts which have posted using a certain hashtag. but i don't have an app. i am confused what i need to do to get the access token.

    • @justinstolpe
      @justinstolpe  5 месяцев назад

      Thanks! You can query for posts based on a hashtag. Check out my video on hashtags ruclips.net/video/TuQt5vW4uTw/видео.html

  • @samuelmiller
    @samuelmiller 4 года назад +1

    Keep getting this error: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'. Idk why

    • @justinstolpe
      @justinstolpe  4 года назад

      hmm do you have the correct domain specified and spelled correctly "graph.facebook.com/v6.0/" That error sounds like the url to the enpoint is not configured correctly.

  • @Smoked93POL
    @Smoked93POL Год назад +2

    video outdated -> 'message': 'Invalid OAuth access token - Cannot parse access token'

  • @manojcs2284
    @manojcs2284 3 года назад +1

    Very good content😊

  • @MechanizeCode
    @MechanizeCode 4 года назад +1

    Great job and thanks for sharing this knowledge.

  • @egulich
    @egulich 3 года назад +1

    Great video!

  • @ayakovtsev
    @ayakovtsev 4 года назад +1

    Greate video! Thnks for it!

  • @niceperson6412
    @niceperson6412 Год назад

    Hey Justin, your video is the rescue! I was also wondering if we could use long lived token ( not yet expired ) to generate a new long lived token.

    • @justinstolpe
      @justinstolpe  Год назад

      I don't think but I believe the long lived tokens will refresh their expire date when the user uses them. Only way they would expire is if the user does not use the token for 60 days.

  • @naheliegend5222
    @naheliegend5222 3 года назад +1

    I am totally confused about the Facebook and instagram thing. There is an endpoint to create an IG-APP long-lived-access-token as well... why not using it?

    • @justinstolpe
      @justinstolpe  3 года назад +1

      Yeah I could make a video for it

  • @panchomarquez
    @panchomarquez 3 года назад

    Excelent content. This help me a lot. Great content.

  • @fathulansori435
    @fathulansori435 2 года назад +1

    thak bro your genius

  • @sohamjadhav5001
    @sohamjadhav5001 Год назад +1

    Heyy Great content! By the way I have an error for the long lived token saying that "Unsupported get request, Object with ID 'v6.0oauth' does not exist, cannot be loaded due to missing permissions. "

    • @justinstolpe
      @justinstolpe  Год назад

      Thanks! That error is saying you are trying to pass an object ID of "v6.0auth" which is not an ID. Check and make sure your ids are in the correct spots and the request and endpoint string are defined correctly.

  • @CR-rm8rb
    @CR-rm8rb 2 года назад

    When I run the debug_access_token.py script, I get indentation errors in the w10 command prompt. Any ideas?

    • @justinstolpe
      @justinstolpe  2 года назад

      hmm not sure have not seen that error before

  • @nandafadhli869
    @nandafadhli869 Год назад

    Hi Justin, Is this possible to use that token to do instagram scrapping?

    • @justinstolpe
      @justinstolpe  Год назад

      You can use the access tokens to get data from endpoints as long as the users account is not a personal private account.

  • @elherediaenc
    @elherediaenc 4 года назад

    Awesome tutorial, thanks! If I add a Facebook Login on my app, will users(businesses or creators) be able to check their posts, media, etc... ?

    • @justinstolpe
      @justinstolpe  4 года назад

      As long as the account is connected to a page developers.facebook.com/docs/instagram-api/overview#pages

  • @zurps
    @zurps 4 года назад

    Not sure if you can help with this, but I can't seem to get the long lived token, requests gives a "Failed to establish a new connection: [Errno 11001] getaddrinfo failed" error. Any ideas? I think it may be due to forcing https?

    • @justinstolpe
      @justinstolpe  4 года назад

      I have not seen that "getaddrinfo failed" so I am not quite sure what the issue is. You can also use the Graph API explorer to make requests which makes testing the endpoints easier developers.facebook.com/tools/explorer/

    • @egulich
      @egulich 3 года назад +1

      Hey I had this issue as well. It is most likely that you spelled something wrong. In my case I typed "graph.facebook.com" instead of "graph.facebook.com/". The difference here was the "/". I found this error from "(host='graph.facebook.comv10.0', port=443)" and noticed that there was no slash in there. This was my issue, so you might have had an issue similar to mine.

  • @jockeytu32
    @jockeytu32 3 года назад

    Thanks for the instructions!
    How can apply the Facebook Permissions for internal data analysis use?

    • @justinstolpe
      @justinstolpe  3 года назад

      You can use the facebook graph api explorer tool to generate tokens for use.

  • @GeneralBlorp
    @GeneralBlorp 3 года назад

    Why use string yes/no parameter when you have a binary outcome that could easily take True/False? Wouldn't that be easier to read and therefore more "correct" per the Pythonic mantra?

    • @justinstolpe
      @justinstolpe  3 года назад

      I probably had some reason at the time for doing so but don't recall, using true/false would be more correct

  • @DataPro360
    @DataPro360 4 года назад

    congratulations, your content helped me a lot.
    How can I do to implement webhook in this code in python, would you have any documents or videos to help me?
    Thank you Fernandes Brazil

    • @justinstolpe
      @justinstolpe  4 года назад

      Thanks, I do have one on webhook ruclips.net/video/82cpdEisqsA/видео.html you could get an overview and write it in python

  • @arunreghu7338
    @arunreghu7338 4 года назад

    Using these graph APIs can we get Instagram user-created posts within a particular hashtag?

    • @justinstolpe
      @justinstolpe  4 года назад

      I do not think you can search for a users posts with a hashtag through the API. You could however grab and store all the users posts, then write a script that searches each post for a hashtag.

  • @naheliegend5222
    @naheliegend5222 3 года назад

    /debug_token does not work. placed my access_token as input_token and access_token and I don't get a proper response. WHY? This API drives me nuts.

    • @justinstolpe
      @justinstolpe  3 года назад

      Yeah the API can be frustrating especially with no response. Maybe try the graph explorer tool at developer.facebook.com to get more insight into your token.

    • @naheliegend5222
      @naheliegend5222 3 года назад

      @@justinstolpe thank you. Yes, that is the way I will go.

  • @joedelorimier4454
    @joedelorimier4454 4 года назад

    Is there any way you could demo accessing another instagram user's data? What does that permission process look like?

    • @joedelorimier4454
      @joedelorimier4454 4 года назад

      It would be interesting to be able to have count of likes, count of comments, and the date for each post that a user (not you) made

    • @justinstolpe
      @justinstolpe  4 года назад

      Here is what the permission process would look like ruclips.net/video/RTwzPdMoTg0/видео.html

    • @justinstolpe
      @justinstolpe  4 года назад

      This is possible with the Insights endpoints. I will be making a video for getting Insights with the Instagram Graph API using python.

    • @joedelorimier4454
      @joedelorimier4454 4 года назад +1

      ​@@justinstolpe Okay awesome! Really appreciate these videos and all the time you put into them. So super helpful.

  • @amandafinn1942
    @amandafinn1942 3 года назад

    Thank you so much! I'm new to programming and this worked on my first try which is not what I'm used to

    • @justinstolpe
      @justinstolpe  3 года назад +1

      Glad it worked on the first try!

  • @felicemcc
    @felicemcc 3 года назад +1

    Please normalize your audio and thanks so much for the tutorial and code.

  • @parthpatankar8340
    @parthpatankar8340 4 года назад

    I don't have redirect url. What should I put?

    • @justinstolpe
      @justinstolpe  4 года назад

      You do not need it for this video

  • @hossein824
    @hossein824 4 года назад +1

    why are you still using python2?

    • @justinstolpe
      @justinstolpe  4 года назад

      It is just what got installed way back when I installed cygwin, I did not notice until you mentioned it, time for upgrade :D

  • @matiasdipaola3342
    @matiasdipaola3342 4 года назад

    Thanks for the tutorial series justin , really helpfull!. I have trouble with the IG permissions when generating the access token, facebook denied and send me to an app review, so when I want to retrieve the data object in the response, it is empty. Has anyone here had a similar issue? I ve created a new facebook page (almost empty) to link my instagram, could this be the problem? Thank you!

    • @justinstolpe
      @justinstolpe  4 года назад +1

      When your app is in live mode, it needs to be reviewed and approved before you can start getting live data. This is probably why you are not getting anything in your response.

  • @maheshbarge3222
    @maheshbarge3222 4 года назад

    i want to do the same for creator account

  • @rob.sisson
    @rob.sisson 4 года назад

    Thank you :D

  • @parthpatankar8340
    @parthpatankar8340 4 года назад

    Also how can I get access toke without manually copying it from developers app..coz I will be giving my app to someone else to use it and they cannot do that...
    Please help..please

    • @justinstolpe
      @justinstolpe  4 года назад +1

      Without manual copying from the developers app you have to implement something like this ruclips.net/video/dEDKOcPuXlU/видео.html

    • @parthpatankar8340
      @parthpatankar8340 4 года назад

      @@justinstolpe yes I saw that video. And in that u put a redirect url..I don't have redirect url nor webpage...
      I just want my python app to login into account get access token and do analysis on fetched data...so how can I do that?

    • @parthpatankar8340
      @parthpatankar8340 4 года назад

      @@justinstolpe also is there way to do this with python

    • @parthpatankar8340
      @parthpatankar8340 4 года назад

      ??

    • @justinstolpe
      @justinstolpe  4 года назад

      @@parthpatankar8340 You need to present users with a facebook login dialog so they can authorize your app. This is the only way to get the access token.

  •  2 года назад

    Is this video at 1.25x? :'D