Why /v2/sizes doesn't returns all available sizes?

Posted January 4, 2019 1.2k views

A GET request to “” should return a list of the available sizes.
But when i try with

curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer ****" "" | jq ".sizes[] | .slug"

I get

  • “512mb”
  • “s-1vcpu-1gb”
  • “1gb”
  • “s-1vcpu-2gb”
  • “s-1vcpu-3gb”
  • “s-2vcpu-2gb”
  • “s-3vcpu-1gb”
  • “2gb”
  • “s-2vcpu-4gb”
  • “4gb”
  • “c-2”
  • “s-4vcpu-8gb”
  • “8gb”
  • “c-4”
  • “s-6vcpu-16gb”
  • “16gb”
  • “c-8”
  • “s-8vcpu-32gb”
  • “s-12vcpu-48gb”
  • “32gb”

I have tried to resize a machine to a not-listed-above “c-16” size and its works! So my question is, why it is missing from the list returned by “/v2/sizes” ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

List responses from the DigitalOcean API are paginated. By default, only 20 items are listed in the first page. For example, this will return 20:

curl -X GET -H "Content-Type: application/json" \
    -H "Authorization: Bearer $DO_TOKEN" \
    "" | \
    jq ".sizes[] | .slug" | wc -l

If we made this query without the jq filter, we would see the response contains:

  "links": {
    "pages": {
      "last": "",
      "next": ""
  "meta": {
    "total": 29

This indicates that there are additional results that can be accessed on the next page by appending the page=2 query parameter to the request.

If you want to access more than 20 results per page, you can adjust this using the per_page query parameter. The maximum number of results in a page is 200. So adjusting our request to use per_page=200:

curl -X GET -H "Content-Type: application/json" \
    -H "Authorization: Bearer $DO_TOKEN" \
    "" | \
    jq ".sizes[] | .slug" | wc -l

we get 29 results. Also, the links section of the response will be empty indicating that there are no additional pages.

  • This does not seem to work as expected? You can set per_page to something < 10 and it will only return that many results, but you cannot set it to something more than 10. If you set page to something > 1, per_page has to be less than 10 to get something back. It’s as if there are only ten sizes.

    For example, you last curl script returns “10”.