LogoLogo
CSPR.build Portal
1.0.x
1.0.x
  • Documentation
    • Introduction
    • Overview
      • Authorization
      • Rate limits and quotas
      • Pagination
      • Sorting
      • Filtering
      • Optional properties
      • Errors
    • Getting started
    • Highlights
      • Including related entities
      • Including CSPR rates
      • Including account info
      • Accessing auction data
      • Accessing token data
      • Accessing NFT data
      • De-anonymizing account hashes
      • De-anonymizing account purses
      • Receiving contract-level events
    • Changelog
  • REST API
    • Reference
    • Account
      • Get account
      • Get accounts
    • Account Info
      • Get account info
      • Get account infos
    • Auction metrics
      • Get auction metrics
    • Awaiting deploy
      • Create Awaiting Deploy
      • Add Awaiting Deploy signatures
      • Get Awaiting Deploy
    • Block
      • Get block
      • Get blocks
      • Get validator blocks
    • Bidder
      • Get bidder
      • Get bidders
    • Contract
      • Get contract
      • Get contracts
      • Get contracts by contract package
      • Get contract types
    • Contract entry point
      • Get contract entry points
      • Get contract entry point costs
    • Contract package
      • Get contract package
      • Get contract packages
      • Get account contract packages
    • Delegation
      • Get account delegations
      • Get validator delegations
    • Delegator reward
      • Get account delegator rewards
      • Get delegator total rewards
    • Deploy
      • Get deploy
      • Get deploys
      • Get account deploys
      • Get block deploys
      • Get deploy execution types
    • Fungible token action
      • Get fungible token actions
      • Get fungible token action types
      • Get account fungible token actions
      • Get contract package fungible token actions
    • Fungible token ownership
      • Get account fungible token ownership
      • Get contract package fungible token ownership
    • Non-fungible token (NFT)
      • Get NFT
      • Get account NFTs
      • Get contract package NFTs
      • Get NFT standards
      • Get off-chain NFT metadata statuses
    • Non-fungible token (NFT) action
      • Get contract package NFT actions for a token
      • Get account NFT actions
      • Get contract package NFT actions
      • Get NFT action types
    • Non-fungible token (NFT) ownership
      • Get contract package NFT ownership
      • Get account NFT ownership
    • CSPR rate
      • Get the current currency rate
      • Get historical currency rates
      • Get currencies
    • CSPR supply
      • Get supply
    • Transfer
      • Get account transfers
      • Get deploy transfers
    • Validator
      • Get validator
      • Get validators
    • Validator performance
      • Get historical validator performance
      • Get historical average validator performance
      • Get historical average validators performance
    • Validator reward
      • Get validator rewards
      • Get validator total rewards
  • Streaming API
    • Reference
    • Account balance
    • Block
    • Contract
    • Contract package
    • Contract-level events
    • Deploy
    • Fungible token action
    • Non-fungible token (NFT)
    • Non-fungible token (NFT) action
    • Transfer
  • Casper Node API
    • Connecting with an SDK
Powered by GitBook
On this page
  • Prerequisites
  • Request access token
  • First API call
  • What's next
  1. Documentation

Getting started

PreviousErrorsNextHighlights

Last updated 1 year ago

This tutorial will help you make your first API call to receive a list of NFT tokens in the contract.

Prerequisites

We will use cURL to make API calls. You can install it from the website or by using the package manager of your choice.

Request access token

Please leave your access request at the website if you haven't done it yet. Once we review it, we'll send you an email with your access token. Keep an eye on your inbox.

While waiting, you can play with the API using the demo access token 55f79117-fc4d-4d60-9956-65423f39a06a. Note, that it's a shared token and it can drain its rate limit and quotas quickly.

First API call

To fetch the NFT tokens in the contract we'll be using the . The endpoint requires a contract package hash, which we can find on :

curl -X 'GET' \
  'https://api.cspr.cloud/contract-packages/c4e5a03066ce3c6006f562939e48f7076c77de5d46cf8fe625c41e02c5e74814/nft-tokens' \
  -H 'accept: application/json' \
  -H 'authorization: [Your access token]'
{
  "data": [
    {
      "contract_package_hash": "c4e5a03066ce3c6006f562939e48f7076c77de5d46cf8fe625c41e02c5e74814",
      "is_burned": false,
      "offchain_metadata": null,
      "offchain_metadata_status": 0,
      "onchain_metadata": {
        "asset": "https://maritime.sealstorage.io/make/c4e5a03066ce3c60/0a14a18a7a214b64a9da1e5bdfe12ded",
        "description": "Friday morning in Рíвне.",
        "name": "Friday morning in Rivne"
      },
      "owner_hash": "8297d55f4530ac75f46d04319bf4c7d1de68de1b3fe31cd462f752fadf27b571",
      "owner_type": 0,
      "timestamp": "2022-10-31T07:20:42Z",
      "token_id": "1",
      "token_standard_id": 1,
      "tracking_id": 6053
    },
    {
      "contract_package_hash": "c4e5a03066ce3c6006f562939e48f7076c77de5d46cf8fe625c41e02c5e74814",
      "is_burned": false,
      "offchain_metadata": null,
      "offchain_metadata_status": 0,
      "onchain_metadata": {
        "asset": "https://maritime.sealstorage.io/make/c4e5a03066ce3c60/69a349373da14f6f9511e2a8d375657e",
        "description": "Dougal loving life on the edge",
        "name": "Flying Dougal"
      },
      "owner_hash": "2af66211f9fb970ead08bb80d3d05ad385f83e51caf4940c2f2eb309a0427828",
      "owner_type": 0,
      "timestamp": "2022-11-15T16:54:36Z",
      "token_id": "10",
      "token_standard_id": 1,
      "tracking_id": 11228
    },
    ...
    {
      "contract_package_hash": "c4e5a03066ce3c6006f562939e48f7076c77de5d46cf8fe625c41e02c5e74814",
      "is_burned": false,
      "offchain_metadata": null,
      "offchain_metadata_status": 0,
      "onchain_metadata": {
        "asset": "https://maritime.sealstorage.io/ipfs/bafybeif6wojygvwuav4wdt7dyqx2ekem4fqdpx47p3fu2e5yh7y6anqr2u",
        "description": "The “Ghost” collection is a unique serie of NFTs found on the Casper blockchain. These NFTs are digital representations of ghosts, spirits, and paranormal phenomenon that have been meticulously designed and created by digital artists. Each NFT in this collection is a unique and exclusive piece that captures the essence of the supernatural and the mysterious.\n",
        "name": "Ghosts"
      },
      "owner_hash": "a485e8c7fbe2bfd939930dd9d94025b403fe4bfcf0f8f46b31bd9f28298b8890",
      "owner_type": 0,
      "timestamp": "2023-10-07T08:31:23Z",
      "token_id": "1006",
      "token_standard_id": 1,
      "tracking_id": 317986
    }
  ],
  "item_count": 1277,
  "page_count": 128
}

Replace "[Your-Access-Token]" with your actual access token in each example.

What's next

Please proceed with the following documents to get familiar with CSPR.cloud:

Learn about the general technical aspects of CSPR.cloud API, and how it works

Learn about CSPR.cloud API possibilities, which aren't present in the Casper Node RPC API

Get familiar with the REST API reference to know what endpoints are available

Get familiar with the Streaming API reference to know what Web Socket subscriptions are available

Learn how to connect to the private Casper Node powered by CSPR.cloud using the most popular SDKs

While CSPR.cloud handles your dApp integration with the Casper Network, CSPR.click takes care of how users of your dApp interact with the blockchain. It provides integration with all the wallets and on-ramp providers in the Casper ecosystem to solve authentication and token-acquiring problems. Please be sure to check it out!

CSPR.studio
curl.se
CSPR.cloud
CSPR.studio
NFT API
CSPR.live
Overview
Highlights
REST API
Streaming API
Casper Node API
CSPR.click