Get NFT by contract and token ID

Returns detailed information about a specific NFT including collection data and metadata

GEThttps://api.1inch.com/nft/v2/contract

Parameters

chainId
* number (Enum)query
contract
* string query
id
* string query
provider
* string (Enum)query

Request Body

This request doesn’t have any request body.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const axios = require('axios');

async function httpCall() {
  const url = 'https://api.1inch.com/nft/v2/contract';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {
      contract: '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D',
      id: '1234',
      provider: 'OPENSEA',
    },
    paramsSerializer: {
      indexes: null,
    },
  };
  const body = {};

  try {
    const response = await axios.get(url, body, config);
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

Returns

200
400
401
500
SingleNft object
id
* string
token_id
* string
name
* string
image_url
* object
chainId
* number
provider
* string
description
* string
collection
* any
allOf[0]
Collection object
image_url
* string
name
* string
description
* string
creator
* any
allOf[0]
Creator object
profile_img_url
* string
address
* string
user
* any
allOf[0]
User object
username
* string
traits
* array
items
Traits object
value
* string
asset_contract
* any
allOf[0]
AssetContract object
address
* string
schema_name
* string
JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "id": "string",
  "token_id": "string",
  "name": "string",
  "image_url": null,
  "chainId": 0,
  "provider": "string",
  "description": "string",
  "permalink": "string",
  "collection": {
    "image_url": "string",
    "name": "string",
    "description": "string"
  },
  "creator": {
    "profile_img_url": "string",
    "address": "string",
    "user": {
      "username": "string"
    }
  },
  "traits": [
    {
      "value": "string"
    }
  ],
  "asset_contract": {
    "address": "string",
    "schema_name": "string"
  }
}

Did you find what you need?