Data API v3/me/models


(Klaasnienhuis) #1

I’m looking for a way to efficiently get a list of my models through the data API. I just need a few properties per model: uid, date created and name, preferably chronologically (newest first). I’ve started with the v3/me/models endpoint and it works. But it gives me so much data, and the results are also paginated with a prev/next cursor.

Can I do the following:

  • specify in the request I want the results sorted chronologically
  • make the response only include the fields that I want
  • specify in the request the pagination count

(Klaasnienhuis) #2

Ok, looking more closely at the documentation, and piecing things together I can answer two of my three questions

  • Add sort_by=-createdAt to the request URL to sort the results newest first. While this isn’t documented for the v3/me/models endpoint, it works.
  • Add count=10 to determine the pagination size. The maximum is 24 items per page

the full URL would be https://api.sketchfab.com/v3/me/models?count=5&sort_by=-createdAt


#3

We don’t yet have an include parameter, but it’s a good idea.