Jump to content

Instagram Search Query


Recommended Posts

Can anyone figure out what Instagram's search query is?

 

I'm trying to create a Custom Search for Instagram.

 

Unlike Twitter (and so many other websites) which uses a "XYZ.com/search?q=" format, Instagram delivers search results in a drop down box (without changing/showing the search query URL). Maybe for that reason it's not possible. But I thought I'd ask.

Thanks, GK Dude

Link to post

@GK Dude It's something I've played with on many occasions, but Instagram make it intentionally hard/impossible to search or index, to ensure that everyone uses their mobile app (even the desktop site has limited functionality) so this may not be possible. 

Link to post

From my limited testing, it’s not possible to add their search to Alfred as a search query, because when you search you don’t get a page — it all happens in the search box — so there’d be nowhere to go. But it is possible to do something better: have the search right within Alfred, like so:

SgFPDfc.png

At the top is the account name and at the bottom is the username. By actioning a result, we’re taken to the account’s page. There’s also extra information we can add:

"pk": "242010666",
"username": "alfred",
"full_name": "Alfred",
"is_private": false,
"profile_pic_url": "https://instagram.flis8-2.fna.fbcdn.net/vp/6c83fb2f60b946c2b6e612c8a7cb4ba7/5CD1747B/t51.2885-19/s150x150/40622263_464380584049499_8502299894608822272_n.jpg?_nc_ht=instagram.flis8-2.fna.fbcdn.net",
"profile_pic_id": "1871182137883861073_242010666",
"is_verified": true,
"has_anonymous_profile_picture": false,
"follower_count": 118563,
"reel_auto_archive": "on",
"byline": "118k followers",
"mutual_followers_count": 0,
"following": false,
"outgoing_request": false

Any of that can be included in the result. We can even add the profile picture to the results, but as you can expect that will slow down getting the list. I haven’t tested how much it slows it down, but it will definitely be noticeable.

 

You can get that trial Workflow here. Currently it only returns users, but it can be changed to return hashtags as well. I won’t use this, so you tell me how you want it to work. You might notice I’m not using my usual more permanent storage solution, instead opting for the fickle 15-days-only option. That is because I haven’t yet decided if it’s a good idea to make/share this.

 

Instagram’s search on the web works like this:

  1. You type your query.
  2. They send a request to a specific address, with your query.
  3. A JSON is returned.
  4. They parse it and present the results.

The workflow is essentially requesting the JSON directly and formatting it to fit Alfred’s Script Filter. In theory the Workflow is (slightly) better for Instagram because you’re making fewer network requests. In practice, as a company they might not like that, which is what makes me reticent of making this into a full-fledged Workflow for wider sharing. But they probably won’t mind if it’s a couple of people using it, as it’s going to be a drop in the bucket.

 

So let me know if this is helpful and what changes you’d like to see.

Link to post
  • 1 year later...
On 1/10/2019 at 8:58 PM, vitor said:

You can get that trial Workflow here. Currently it only returns users, but it can be changed to return hashtags as well. I won’t use this, so you tell me how you want it to work. You might notice I’m not using my usual more permanent storage solution, instead opting for the fickle 15-days-only option. That is because I haven’t yet decided if it’s a good idea to make/share this.

 

Hi Vitor, can you please share again this workflow? Much appreciated.

Link to post
  • 6 months later...
9 hours ago, Chris Messina said:

Is it?


If you read the post, you’ll see I’ve explained how it’s done. Yes, it’s straightforward, but you can’t do it without coding.

Link to post
8 hours ago, vitor said:

If you read the post, you’ll see I’ve explained how it’s done. Yes, it’s straightforward, but you can’t do it without coding.

 

I did, but the links to the sample workflows are broken. I don't mind trying to do some coding but I was hoping to learn from those workflows that were previously shared...

Link to post
1 hour ago, Chris Messina said:

the links to the sample workflows are broken.

 

By design, as is also explained in the post. If you’re able to code the Workflow (or understand it after having access to it), you should also be able to figure out the missing piece: the API URL which can be retrieved with the browser’s developer tools by inspecting the network traffic when performing a search.


I no longer have an Instagram account (only tried it briefly) and they’re pretty hostile about getting your data nowadays (even more than before) and don’t let you look at anything without agreeing to data collection, so I have no desire to rebuild the Workflow. But I’m not opposed to any of the previous people sharing it in this thread.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...