How many requests per second are allowed ?

kraftmugkraftmug Registered Users Posts: 1 Beginner grinner
I understand it's a bit of an odd question, but I'm looking for best practices to talk to the API.

I am building a website for a client, where image galleries will be embedded.
I have set up a database, where for each album, I store the SmugMug album key.
On the SmugMug end, I apply certain keywords to images that should be displayed on this remote website.

This works fine when populating a page, and retrieving a subset of images that are inside that specific SmugMug album.

However, I also need to create a principle overview page, where one thumbnail is displayed for each available album.
Currently I only have 70 albums on SmugMug, but this will and should expand once I have set up this website.

I am using phpSmug to do the talking to the API, and I have this call inside a while loop
$images = $client->get('/api/v2/album/'.$albumkey.'!images?_filter=ThumbnailUrl,Keywords&_filteruri=ThumbnailUrl');

After that, I loop through the list and filter out a single image that has the "title" keyword applied, and this image is used to display in a grid.

Unsurprisingly, performance is not good at all.

I admit that this is kind of messy, but it's the best I could come up with so far.
Certainly, there must be a better way to do what I am trying to do, but I can't seem to figure it out.

i.e. could I just send one request to the API and get all image urls that have a certain keyword applied, "title" in my case ? (and not go from album to album)
Sign In or Register to comment.