Can we pick the user instagram avatar from instagram username?

Hey guys, new challange!

Can we pick the user instagram avatar from instagram username?

Example

User name: willsmith

1 Like

There’s no direct way to do that I think. You would have to fetch the link from Instagram’s API.

The link to fetch, taking @willsmith as an example:

https://www.instagram.com/willsmith/?__a=1

The profile image URL (profile_pic_url_hd):

https://instagram.fsgn5-10.fna.fbcdn.net/v/t51.2885-19/s320x320/140570243_693797584646033_2762531085115909555_n.jpg?_nc_ht=instagram.fsgn5-10.fna.fbcdn.net&_nc_ohc=Tgakxnj7Rj8AX-SjmEL&edm=ABfd0MgBAAAA&ccb=7-4&oh=0f87125fd4f97961aba93863dfceba80&oe=6166B1D8&_nc_sid=7bff83

https://unavatar.io/ seems to offer it but you have to get a Microlink Pro account.

2 Likes

I’d like to get it by username by I don’t have any knowledge to do it @ThinhDinh

with Cloudinary you can get an avatar in a simple manner

Is it still available?

1 Like

Oh, sorry. Didn’t know that Instagram is no longer available.

2 Likes

Can @Manu.n @Roldy @SantiagoPerez or someone else achieve this? One of my client wants it, but we can figure it out how to do it instead of manually :confused:

Hello @Lucas_Pires
Sorry I can’t help with this operation.

1 Like

Thank you Manu!

No man! Haven’t even tried before.

1 Like

Thank you!

1 Like
1 Like

It’s late here so I can’t try it but maybe worth a read

1 Like

It’s not late because I havent achieve this yet. Thanks, gonna take a look!

1 Like

Hi. Happy to help you if I can. But it’s too late here, will try tomorrow.

1 Like

It seems to me that the easiest and most feasible way to do this, is as @ThinhDinh indicated at the beginning.
So, if it were for one of my APPs, I would create an apps script function to be launched frequently with trigger that updates the photo column. If you want to do so, I’ll write it to you, it takes a little while.
Let me know.

1 Like

Just a warning, be careful as you can run into some kind of hourly or daily limit for accessing the API. I can recall reading about it on StackOverflow like a year ago.

1 Like

Instagram Graph API

Calls to the Instagram Graph API are counted against the calling app’s call count. An app’s call count is unique for each app and app user pair, and is the number of calls the app has made in a rolling 24 hour window. It is calculated as follows:

Calls within 24 hours = 4800 * Number of Impressions

The Number of Impressions is the number of times any content from the app user’s Instagram account has entered a person’s screen within the last 24 hours.


Thanks to your warning, the function may try to retrieve the information and if it fails then it will try next time. This is because I believe we cannot know the Number of Impressions.
What do you think @ThinhDinh ?

1 Like

Still seems too risky for my liking considering we don’t know the number of impressions. It can fail anytime.

1 Like

Surely, the idea would be to manage failure as well, trying again at the next trigger. It certainly can cost a lot in terms of time quota limits for scripts, especially if there are a lot of profiles to query.
It all depends on the degree of acceptability of the data in the APP (sometimes the image is there, sometimes not).

2 Likes