Searching a specific album
Freeheelvrmnt
Registered Users Posts: 29 Big grins
In reading on the API 2.0 thread I found this http://api.smugmug.com/api/v2/image!search
Is it possible to restrict the search to a particular folder? I have events that where I tag competitors by bib number and allow them to search for themselves. Obviously bib numbers repeat across events so when I search I need to restrict to a specific event. I'd like to play with the api to do this instead of my current solution.
Any advice?
Thanks!
Is it possible to restrict the search to a particular folder? I have events that where I tag competitors by bib number and allow them to search for themselves. Obviously bib numbers repeat across events so when I search I need to restrict to a specific event. I'd like to play with the api to do this instead of my current solution.
Any advice?
Thanks!
0
Comments
With the v2 search API, that would be something like:
http://api.smugmug.com/api/v2/user/MikeJulianaPhotography!imagesearch?q=may+day%2C+men&Order=Newest
I don't think there is a folder or album-specific keyword search capability in the v2 API.
There is a gallery/folder-specific search capability in the v1.4.0 API, which is the SM internal API that the search content block uses for its "search scope" capability. So let's say I want to search only within this folder:
http://www.sherlockphotography.org/Anime-figures/Anime-figure-collection/
I check out the sourcecode and find the nodeId "jT2v3" for this folder (the nodeId comes from the "n-jT2v3" part you would see appearing on the end of the URL if the folder/gallery was unlisted). Now I can use that nodeId in my query to the 1.4.0 API:
http://www.sherlockphotography.org/services/api/json/1.4.0/?Query=gokou+ruri&Start=0&Facets=%7B%22imagetype%22%3A%5B%221%22%5D%7D&NickName=n-sherlock&Size=60&SortBy=popular&ScopeType=node&ScopeValue=jT2v3&method=rpc.search.images
Please check out my gallery of customisations for the New SmugMug, more to come!