This morning, I wanted to send someone an iTunes App Store search URL, so that when they clicked it, they'd see the list of matching apps in the iTunes App Store. There's no apparent easy way to do this within iTunes, but after much futzing about, I figured out how to structure a URL that will open to to the search results screen in the iTunes App Store.
Because Apple has separated iPhone apps and iPod apps in the store, there are actually two separate URLs, one for each type of app. The iPad version of the URL is:
itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?entity=iPadSoftware&free=0&genreIndex=1&media=software&restrict=false&softwareTerm=TERMS+TO+SEARCH+FOR&submit=seeAllLockups
And for the iPhone, it's identical except for the entity bit:
itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?entity=software&free=0&genreIndex=1&media=software&restrict=false&softwareTerm=TERMS+TO+SEARCH+FOR&submit=seeAllLockups
Hopefully obviously, replace TERMS+TO+SEARCH+FOR with the keywords you want to use for the search, separating words with the plus sign. You can then use the URL for whatever you like: send it to someone, add it to your bookmarks bar, whatever. When clicked, the search will run and the results will open directly in the iTunes App Store for either iPad or iPhone apps.
For example, iPad Apps related to the word foobar, or iPhone apps about hopping frogs.
You can further customize the URL to find anything you want—not just apps, and using additional criteria—within any of the various areas of the App Store. Read on for the details on how to do that.
To create a custom search URL you can send to anyone (or use in bookmarks, etc.), use this process:
- Start with the iTunes Store advanced search tool; this used to exist as a link within the iTunes Store, but Apple removed it because, well, Apple. (Thanks to Kirk McElhearn for pointing out that you can still use it.).
- Set the Power Search pop-up to what you want to find; in my case, I set it to Apps. Note: Trying to set the Power Search pop-up to Books causes an iTunes error; it seemed to work fine for all the other options, though
- Fill in Title/Keywords, Developer Name, etc. as you wish, then click Search. This will show you the results below your search; here's how it looks for the 'foobar' apps search:
- Now just drag the "See All" link from the top of the results window (in either the iPad Apps or iPhone Apps sections of the above image, for example) to your browser, a text editor, etc. This will paste the link, and you can then use it as you see fit.
With the ability to create a custom search URL, you can then make your own not-in-iTunes search tool using any app that lets you build a URL in pieces and send it. (Our own Butler will let you do just this, as will LaunchBar and many other such apps.)
Or you can take it to ridiculous extremes, as I did, and build an AppleScript app to let you run seaches via an onscreen dialog, like this:
I have this AppleScript app bound to a hot key in Butler, so I can search the iTunes store via a quick keyboard shortcut. Here's the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | try choose from list {"Music [artist]", "Music Video [artist]", "Movies [title]", "Movies [keyword]", "TV Shows [title]", "TV Shows [keyword]", "iPad Apps", "iPhone apps", "Podcasts", "iTunes U"} with title "iTunes Store Search" with prompt "Search iTunes Store for..." default items "iPad Apps" if the result is false then set userCanceled to true else set searchArea to item 1 of the result set userCanceled to false end if end try if userCanceled then display dialog "You canceled." buttons "OK" else try display dialog "Search for what?" default answer "" on error number -128 set userCanceled to true end try if userCanceled then display dialog "You canceled." buttons "OK" else set searchFor to text returned of result set AppleScript's text item delimiters to " " set the itemList to every text item of searchFor set AppleScript's text item delimiters to "+" set searchFor to the itemList as string set AppleScript's text item delimiters to "" set musicURL to "itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?genreIndex=1&media=music&restrict=true&submit=seeAllLockups&entity=" set movieURL to "itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?closedCaption=0&flavor=0&genreIndex=1&media=movie&ratingIndex=1&restrict=false&submit=seeAllLockups&entity=movie&" set tvURL to "itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?entity=tvSeason&flavor=0&media=tvShow&restrict=true&submit=seeAllLockups&" set appURL to "itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?free=0&genreIndex=1&media=software&restrict=true&softwareTerm=" & searchFor & "&submit=seeAllLockups&entity=" if (searchArea = "Music [artist]") then set searchURL to musicURL & "album&allArtistNames=" & searchFor else if (searchArea = "Music Video [artist]") then set searchURL to musicURL & "musicVideo&allArtistNames=" & searchFor else if (searchArea = "Movies [title]") then set searchURL to movieURL & "movieTerm=" & searchFor else if (searchArea = "Movies [keyword]") then set searchURL to movieURL & "descriptionTerm=" & searchFor else if (searchArea = "TV Shows [title]") then set searchURL to tvURL & "showAndSeasonTerm=" & searchFor else if (searchArea = "TV Shows [keyword]") then set searchURL to tvURL & "descriptionTerm=" & searchFor else if (searchArea = "iPad Apps") then set searchURL to appURL & "iPadSoftware" else if (searchArea = "iPhone apps") then set searchURL to appURL & "software" else if (searchArea = "Podcasts") then set searchURL to "itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?entity=podcast&genreIndex=1&media=podcast&podcastMediaTypeTerm=0&restrict=true&submit=seeAllLockups&descriptionTerm=" & searchFor else set searchURL to "itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?closedCaption=0&entity=iTunesUPodcast&media=iTunesU&restrict=true&submit=seeAllLockups&allTitle=" & searchFor end if open location searchURL end if end if |
Paste the above into AppleScript Editor, then save it as an application, and you're ready to go—just launch it using your preferred method, and you'll see the pop-up dialog. (This code could probably be greatly optimized; I am not a coder, and know just enough AppleScript to get myself in trouble. But it does work, and it makes searching for stuff in the iTunes Store much simpler.)
As a bit of an aside, there's also an official search API, but it's not all that useful without some backend processing. For example, try searching for apps that use the term 'foobar', and while it works, you wouldn't call the results useful:
I also stumbled across find.io, which lets you search the iTunes App Store via a web browser. While this works, I wanted a URL that wound up in the actual iTunes App Store, not on a web page—and I didn't want to open a browser window to search. The above AppleScript does everything I wanted to do, and should work well until Apple (again) changes their search URL structures.
Thanks for the AppleScript.... very useful!
Comments are closed.