Underdog Protocol
  • API Documentation
  • Quickstart
  • Guides
    • Postman
    • Endpoints
    • Authentication
    • Pagination
    • Errors
    • Webhooks
    • Architecture
  • Resources
    • Projects
      • Transferable Projects
      • Non-Transferable Projects
      • NFTs
        • List all NFTs
        • Search NFTs
        • Create an NFT
        • Retrieve an NFT
        • Update an NFT
        • Generate Claim Link
        • Revoke an NFT
        • Burn an NFT
      • Methods
        • List all Projects
        • Create a Project
        • Retrieve a Project
        • Update a Project
        • Retrieve Project Stats
    • NFTs
      • Retrieve an NFT
      • Generate Claim Transaction
    • Orgs
      • List all Orgs
    • Transactions
      • List all Transactions
      • Retrieve a Transaction
    • Webhooks
      • List all Webhooks
      • Create a Webhook
      • Delete a Webhook
    • V1
      • Collections
        • List all Collections
        • Create a Collection
        • Retrieve a Collection
      • NFTs
        • List all NFTs
        • Create an NFT
        • Retrieve an NFT
        • Update an NFT
      • Managed NFTs
        • Claim
        • Revoke
  • Examples
    • Zapier Integrations
      • Zapier + Viral Loops
      • Zapier + Github + OpenAI
      • Zapier + Github
      • Zapier + Mailchimp
      • Zapier + Shopify
      • Zapier + Calendly
      • Zapier + Hubspot
      • Zapier + Typeform
    • Underdog with Airtable
      • Create a Project
      • Create NFT on Form Submission
      • Send a Claim Link
      • Updating NFTs
    • Web3 Blog
    • Mint NFTs on iPhone
  • Use Cases
    • Solana Mobile
    • Parcl
Powered by GitBook
On this page
  1. Guides

Pagination

In this guide, we will look at how to work with paginated responses when querying the Underdog API.

By default, all responses limit results to ten. However, you can go as high as 100 by adding a limit parameter to your requests.

When an API response returns a list of objects, no matter the amount, pagination is supported. In paginated responses, objects are nested in a results attribute and include four attributes to determine whether you have reach the end of the last page.

  • limit

  • page

  • totalPages

  • totalResults

You can use the limit and page query parameters to browse pages.

Example using cursors

In this example, we request the first page with at most one result. As a result, we get a list of one Collection and can tell by the totalResults and totalPages attributes that we have one more page of results.

limit integer

Limit the number of items returned.

page integer

The page number to return.

Manual pagination using cURL
curl "https://api.underdogprotocol.com/v1/collections?limit=1&page=1" \
        -H "Authorization: Bearer {token}"
Paginated response
{
    "results":[{
        "mintAddress":"FrvZAJ1qZ2vhV17nFdEmw66N3FW5QiHFt6HdqsEh8QNq",
        "name":"NBA",
        "description":"",
        "image":"https://arweave.net/57PrJ_-S-m2BXOSkaUN2t5ibsjbSrCjElSVUQXXyCq0",
        "attributes":[],
        "uri":"https://arweave.net/DnftYIM2sNZQBXm7qzRiFoUP0S7QtN4q_GkmIcv1UJ8",
        "collectionDetails":{},
        "ownerAddress":"EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp"
    }],
    "page": 1,
    "limit": 1,
    "totalPages": 1,
    "totalResults": 2
}
PreviousAuthenticationNextErrors

Last updated 2 years ago