API Reference

The Benefits endpoint allows you to retrieve a list of benefits supported by theMiracle API Protocol. These benefits can include airdrops, event tickets, exclusive content, and more, associated with specific NFT collections across different chains. This endpoint includes all benefits gathered from sources coming from Official, Third Party and Community Sources.

Important Notes

  • validFrom and validTo:
    • validFrom: The date when the benefit becomes active and trackable on theMiracle.
    • validTo: The date when the benefit expires and is no longer available.
  • Action Date:
    • Represents the deadline for the user to take a specific action, such as claiming or minting a benefit.
    • May differ from validTo in cases like events where tickets need to be claimed by a certain date (actionDate), but the event occurs later (validTo).

Enhancing Your Product with Benefits

By leveraging the Benefits endpoint, you can enhance your web3 applications in various ways:

  • New Benefits Feed: Display the latest benefits added.
  • Last Chance: Highlight benefits that are expiring soon, creating urgency.
  • Collection Highlights: Showcase benefits associated with specific NFT collections.
  • Personalized Experiences: Present benefits available to individual users based on their wallet holdings.

Examples

New Benefits Feed

Display the most recently added benefits:
Request:

GET https://www.themiracle.io/api/v1/benefits
  ?sortBy=validFrom
  &sortDirection=DESC
  &limit=20

Explanation:

  • sortBy=validFrom: Sorts benefits by the date they became active.
  • sortDirection=DESC: Displays the newest benefits first.
  • limit=20: Returns up to 20 benefits.

Last Chance

Show benefits that are expiring soon:
Request:

GET https://www.themiracle.io/api/v1/benefits
  ?sortBy=validTo
  &sortDirection=ASC
  &limit=20

Explanation:

  • sortBy=validTo: Sorts benefits by their expiration date.
  • sortDirection=ASC: Displays benefits that will expire soonest.
  • limit=20: Returns up to 20 benefits.
Language
Click Try It! to start a request and see the response here!