Sorting a photoset with the Flickr API - flickr

Is there a simple way to sort a photset in reverse chronological order (i.e. "Arrange by date taken (newest first)" using the Flickr API rather than the edit interface?

You can fetch the date_taken field when you call getPhotos, and then sort the results yourself...

Related

Random Valid ASIN via Products API?

I'm working on an algorithm that requires grabbing random Amazon products. Is there a way to grab a random ASIN using the products api? Alternatively, is there a database or list of valid ASINs somewhere from which I can sample?
No there isn't an API available, but what comes next to it is the ListMatchingProducts API operation:
http://docs.developer.amazonservices.com/en_US/products/Products_ListMatchingProducts.html
You can search by keyword or whatever you want and you will get back the ASINs in a handy xml response.
The products API has some example libraries, found here:
https://developer.amazonservices.com/gp/mws/api.html/178-5155936-5152515?ie=UTF8&group=products&section=products&version=latest

Foursquare API: Venues visited by a user sort

For the Foursquare api
Venues visited by a user
https://api.foursquare.com/v2/users/USER_ID/venuehistory
I was wondering if we can change the sort of the venues coming back? It appears to be sorted by alpha. It would be helpful to sort by most recent checkin. Or in addition to the beenHere field add a last_checkin_id: or just date would be fine.
Is there a sort query string parameter that i am missing?
The venuehistory endpoint simply returns all the venues that a user has been to. If you're looking to sort venues by most recent check-in, consider using the user/checkins endpoint instead.

Colleting a neighborhood in foursquare

im making a app in using the Foursquare API, using their API i can get some places in a neighborhood.
I'm using one like that:
https://api.foursquare.com/v2/venues/explore
?ll=40.7,-74
&limit=50
&venuePhotos=1
Using that API i can take 50 venues around my point, but how can I take more others venues like a second page of that?
You can use the "offset" parameter to query for subsequent pages of results. For example, to get the second page, you would supply "offset=50" to indicate skipping the first 50 results.

Foursquare get venue details

We are planning to use foursquare api to get venue in a particular city. I want data of all the food outlets in a particular city. I have managed to get the categories list but not sure how to get venues from that particular category in a particular city or area.
Please share some tutorials or document which i can check out.
One way of doing what you want will be using the Venues Platform for browsing according to a category ID.
Look at venue search API reference.
Example of using it:
I know that 4bf58dd8d48988d11f941735 is nightlife (just picked the first one I saw)
So I will call the API (the ll is someplace in New York):
https://api.foursquare.com/v2/venues/search?ll=40.7268,-73.9972&categoryId=4bf58dd8d48988d11f941735&limit=50&intent=browse&radius=1500&your ids/oauth
Or use the explorer to see results right away.
Important, read the search API and the parameters used here to alter behavior to your needs.
Another very important thing, the API parameters are case sensitive!! (so if they want categoryId, categoryid will not work :) )

Foursquare API - Has there been a change to the core venue field specials?

Has there been a change to the core venue field specials?
I'm using Venue Detail request (https://developer.foursquare.com/docs/venues/venues) to retrieve Venue Detail. As usual this request returns a "venue" for a response field.
What seems to have changed is the core venue field "specials". This now appears to be returning the same response fields as Specials/list ( https://developer.foursquare.com/docs/specials/list).
This requires iteration on specials.items as opposed to specials.
Looking at https://developer.foursquare.com/docs/responses/venue the Core venue field "specials" still should be returned as an array.
I'm trying to find in the change log where this may have changed?
The venues specials object is now using the standard count and items format that other lists in the api use.
The new format is only for clientversion 20120120 and later. Older versions get the old format.
We'll be updating the docs/changelog shortly.

Resources