Count Digital Passports using Data

Retrieve the count of digital passports on your NFT Management Platform.

URL

To return the number of digital passports matching your filters, use /certificate/v2/search/count.

GET - https://{{nmpUrl}}/certificate/v2/search/count
Query ParameterTypeMandatoryDescription
qObjectโœ…JSON encoded key/value request to filter results.
โš ๏ธ When testing in API reference stringify your JSON object.

Field list you can use in your query:

blockNumberCreation, updatedAt,destroyed, issuer, numberOfTransfer, owner, serialNumbers, sku, tags, textSearch, tokenId, walletProfile, whitelist.

Dig deeper into compliant operators here.

Compound you can use in your query to combine operators:

- must: An array of conditions that all must be satisfied. For example, { "range": { "path": "blockNumberCreation", "gt": 0 } } ensures the blockNumberCreation is greater than 0.
- mustNot: An array of conditions that must not be satisfied. For example, { "queryString": { "defaultPath": "owner", "query": "owner: 0x000000000000000000000000000000000000dEaD" } } excludes certificates owned by a specific address.
- regex: Allows searching for fields that match a regular expression. For example, { "regex": { "path": "issuer", "query": "0x.*", "allowAnalyzedField": true } } finds issuers that start with "0x".
- text: Searches for text in a specified field. For example, { "text": { "path": "displayTitle", "query": "example" } } looks for the word "example" in the displayTitle.
More information on compound here and examples here.
{
  "q": {
    "must": [
      {
        "range": {
          "path": "blockNumberCreation",
          "gt": 0
        }
      },
      {
        "regex": {
          "path": "issuer",
          "query": "^0x.*",
          "allowAnalyzedField": true
        }
      }
    ],
    "mustNot": [
      {
        "queryString": {
          "defaultPath": "owner",
          "query": "owner:0x000000000000000000000000000000000000dEaD"
        }
      }
    ]
  }
}

curl --location '<https://nmpUrl.com/certificate/v2/search?q=%7B%22must%22%3A%5B%7B%22range%22%3A%7B%22path%22%3A%22blockNumberCreation%22%2C%22gt%22%3A0%7D%7D%2C%7B%22regex%22%3A%7B%22path%22%3A%22issuer%22%2C%22query%22%3A%220x.*%22%2C%22allowAnalyzedField%22%3Atrue%7D%7D%5D%2C%22mustNot%22%3A%5B%7B%22queryString%22%3A%7B%22defaultPath%22%3A%22owner%22%2C%22query%22%3A%22owner%3A%200x000000000000000000000000000000000000dEaD%22%7D%7D%5D%7D>' \\
--header 'x-api-key: yourApiKey'

Return Payload

FieldTypeDescription
countNumberCount of digital passports minted on your NFT Management Platform.
{
    "count": 99778
}

Errors

Status CodeSuccessDescription
500falseSomething is wrong with your request.
{}
{
    "ok": 0,
    "code": 8,
    "codeName": "UnknownError",
    "$clusterTime": {
        "clusterTime": {
            "$timestamp": "7382159732183662725"
        },
        "signature": {
            "hash": "aPNjdyusTSgGnJxufx08EAFxheE=",
            "keyId": {
                "low": 2,
                "high": 1709154390,
                "unsigned": false
            }
        }
    },
    "operationTime": {
        "$timestamp": "7382159732183662725"
    }
}