Filtering and sorting in the API

jrdavisjrdavis Registered Users Posts: 3 Beginner grinner
Is there a way to filter and sort the results of the SmugMug APIs? Specifically, I'd like to be able to call smugmug.albums.get but just get the six most recently updated albums.

Right now all I see is a "LastUpdated" field that limits the number of albums by date range rather than raw number, and I can't see any way for the web service to sort the results. This is forcing me to download more data than I want to the client and then sort the results there.

Thanks for any help / ideas.

Comments

  • IIMMIIMM Registered Users Posts: 9 Beginner grinner
    edited February 5, 2014
    jrdavis wrote: »
    Is there a way to filter and sort the results of the SmugMug APIs? Specifically, I'd like to be able to call smugmug.albums.get but just get the six most recently updated albums.

    Right now all I see is a "LastUpdated" field that limits the number of albums by date range rather than raw number, and I can't see any way for the web service to sort the results. This is forcing me to download more data than I want to the client and then sort the results there.

    Thanks for any help / ideas.

    I'd like to bump this article for reference. It's nice to be able to get album returns on the albums_get method but it seems to just randomly sort the albums in no particular order -- I was hoping, as well, that it would maybe default to most recent albums first and go backwards from there.

    Any help on this would be appreciated, as I don't want to source this out to a database either.
  • chrissabatochrissabato Registered Users Posts: 5 Big grins
    edited August 11, 2015
    This is a little old, but I'm struggling with the same issue. Using smugmug.albums.get how do I get the the most recent. It seems random.
  • gabbiegabbie Registered Users Posts: 66 Many Grins
    edited August 12, 2015
    Using API 1.3.0, the "LastUpdated" option is the closest thing available for getting information about recent albums. But we do have better support for filtering and sorting in the newest version of the API - API 2.0.0. It's in open beta right now and I fully recommend that you check it out and play around with the new functionality that it provides. For example, our search endpoint would be useful for this scenario: https://api.smugmug.com/api/v2/album!search

    You can learn more about API 2.0.0 in general by checking out our documentation and get access to it by accepting our terms of service on this page. We're happy to help answer any questions about API 2.0.0 and getting started using it.
    gabbie
    SmugMug Product Manager
Sign In or Register to comment.