> For the complete documentation index, see [llms.txt](https://rareful.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rareful.gitbook.io/documentation/reference/api-reference/getting-nft-metadata.md).

# Getting NFT Metadata

These endpoints include finding NFTs and their metadata

## Find NFT Metadata

## Find an NFT from the contract address and token id

<mark style="color:green;">`POST`</mark> `https://api.rareful.io/v1/getNFT`

Finds an NFT and its metadata

#### Headers

| Name                                           | Type   | Description                                                                                       |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------- |
| API\_KEY<mark style="color:red;">\*</mark>     | String | Your API Key can found on the dashboard, and will be used to authenticate all requests (Required) |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json (Required)                                                                       |

#### Request Body

| Name                                                | Type   | Description                                                     |
| --------------------------------------------------- | ------ | --------------------------------------------------------------- |
| contract\_address<mark style="color:red;">\*</mark> | string | The contract address that the NFT was published on.  (Required) |
| token\_id<mark style="color:red;">\*</mark>         | Int    | The token id of the NFT that was minted (Required)              |
|                                                     | String |                                                                 |
| blockchain                                          | String | The blockchain this NFT exists on                               |

{% tabs %}
{% tab title="200 NFT is found" %}

```javascript
{
    "data": {
        "item": {
            "image": "https://nftgo.mypinata.cloud/ipfs/QmXq4BBd4QTjSX8DEDN4Nj7kwmGL8fDndSrVpxukoesiyw",
            "metadata": "https://ipfs.io/ipfs/QmYfeFRtg4tq3upwsPw6xvrP75MYSqyv8E7wpkxNxE4EWr",
            "name": "Awesome NFT 5",
            "owner_public_key": "0x899825b3c2339A2A3d738a933920E7C4F0d001Ff",
            "token_id": "45018383"
        }
    },
    "status": 200,
    "message": "NFT was found"
}
```

{% endtab %}

{% tab title="400 Request was malformed or parameters include wrong data types" %}

```javascript
{
    "data": {},
    "status": 400,
    "message": "There was an error"
}
```

{% endtab %}

{% tab title="401 Likely wrong or missing API Key. " %}

```javascript
{
    "data": {},
    "status": 401,
    "message": "Not Authorized"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Something went wrong on our end. Email us the error at <dev@rareful.com>" %}

```javascript
{
    "status": 500,
    "message": "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## Find an NFT from the contract address and token id if it is for Sale

<mark style="color:green;">`POST`</mark> `https://api.rareful.io/v1/getNFTForSale`

Finds an NFT and its metadata, will not return if the NFT is not listed for sale

#### Headers

| Name                                           | Type   | Description                                                                                       |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------- |
| API\_KEY<mark style="color:red;">\*</mark>     | String | Your API Key can found on the dashboard, and will be used to authenticate all requests (Required) |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json (Required)                                                                       |

#### Request Body

| Name                                                | Type   | Description                                                     |
| --------------------------------------------------- | ------ | --------------------------------------------------------------- |
| contract\_address<mark style="color:red;">\*</mark> | string | The contract address that the NFT was published on.  (Required) |
| token\_id<mark style="color:red;">\*</mark>         | Int    | The token id of the NFT that was minted (Required)              |
| blockchain                                          | String | The blockchain this NFT exists on                               |

{% tabs %}
{% tab title="200 NFT is found" %}

```javascript
{
    "data": {
        "item": {
            "image": "https://nftgo.mypinata.cloud/ipfs/QmXq4BBd4QTjSX8DEDN4Nj7kwmGL8fDndSrVpxukoesiyw",
            "metadata": "https://ipfs.io/ipfs/QmYfeFRtg4tq3upwsPw6xvrP75MYSqyv8E7wpkxNxE4EWr",
            "name": "Awesome NFT 5",
            "owner_public_key": "0x899825b3c2339A2A3d738a933920E7C4F0d001Ff",
            "token_id": "45018383"
        }
    },
    "status": 200,
    "message": "NFT was found"
}
```

{% endtab %}

{% tab title="400 Request was malformed or parameters include wrong data types" %}

```javascript
{
    "data": {},
    "status": 400,
    "message": "There was an error"

Finds an NFT and its metadata
The contract address that the NFT was published on.  (Required)
{
    "data": {
        "item": {
            "image": "https://nftgo.mypinata.cloud/ipfs/QmXq4BBd4QTjSX8DEDN4Nj7kwmGL8fDndSrVpxukoesiyw",
            "metadata": "https://ipfs.io/ipfs/QmYfeFRtg4tq3upwsPw6xvrP75MYSqyv8E7wpkxNxE4EWr",
            "name": "Awesome NFT 5",
            "owner_public_key": "0x899825b3c2339A2A3d738a933920E7C4F0d001Ff",
            "token_id": "45018383"
        }
    },
    "status": 200,
    "message": "NFT was found"
}
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
application/json (Required)
{
    "data": {},
    "status": 401,
    "message": "Not Authorized"
}
The token id of the NFT that was minted (Required)
{
    "status": 500,
    "message": "Internal Server Error"
}
{
    "data": {},
    "status": 400,
    "message": "There was an error"
}}
```

{% endtab %}

{% tab title="401 Likely wrong or missing API Key. " %}

```javascript
{
    "data": {},
    "status": 401,
    "message": "Not Authorized"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Something went wrong on our end. Email us the error at <dev@rareful.com>" %}

```javascript
{
    "status": 500,
    "message": "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

## Find an NFT from the contract address and token id

<mark style="color:green;">`POST`</mark> `https://api.rareful.io/v1/getNFTTransactionHistory`

Finds an NFT and its transaction history

#### Headers

| Name                                           | Type   | Description                                                                                       |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------- |
| API\_KEY<mark style="color:red;">\*</mark>     | String | Your API Key can found on the dashboard, and will be used to authenticate all requests (Required) |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json (Required)                                                                       |

#### Request Body

| Name                                                | Type   | Description                                                     |
| --------------------------------------------------- | ------ | --------------------------------------------------------------- |
| contract\_address<mark style="color:red;">\*</mark> | string | The contract address that the NFT was published on.  (Required) |
| token\_id<mark style="color:red;">\*</mark>         | Int    | The token id of the NFT that was minted (Required)              |
| blockchain                                          | String | The blockchain this NFT exists on                               |

{% tabs %}
{% tab title="200 NFT is found" %}

```javascript
{
    "data": {
        "item": {
            "image": "https://nftgo.mypinata.cloud/ipfs/QmXq4BBd4QTjSX8DEDN4Nj7kwmGL8fDndSrVpxukoesiyw",
            "metadata": "https://ipfs.io/ipfs/QmYfeFRtg4tq3upwsPw6xvrP75MYSqyv8E7wpkxNxE4EWr",
            "name": "Awesome NFT 5",
            "owner_public_key": "0x899825b3c2339A2A3d738a933920E7C4F0d001Ff",
            "token_id": "45018383"
        }
    },
    "status": 200,
    "message": "NFT was found"
}
```

{% endtab %}

{% tab title="400 Request was malformed or parameters include wrong data types" %}

```javascript
{
    "data": {},
    "status": 400,
    "message": "There was an error"

Finds an NFT and its metadata
The contract address that the NFT was published on.  (Required)
{
    "data": {
        "item": {
            "image": "https://nftgo.mypinata.cloud/ipfs/QmXq4BBd4QTjSX8DEDN4Nj7kwmGL8fDndSrVpxukoesiyw",
            "metadata": "https://ipfs.io/ipfs/QmYfeFRtg4tq3upwsPw6xvrP75MYSqyv8E7wpkxNxE4EWr",
            "name": "Awesome NFT 5",
            "owner_public_key": "0x899825b3c2339A2A3d738a933920E7C4F0d001Ff",
            "token_id": "45018383"
        }
    },
    "status": 200,
    "message": "NFT was found"
}
Your API Key can found on the dashboard, and will be used to authenticate all requests (Required)
application/json (Required)
{
    "data": {},
    "status": 401,
    "message": "Not Authorized"
}
The token id of the NFT that was minted (Required)
{
    "status": 500,
    "message": "Internal Server Error"
}
{
    "data": {},
    "status": 400,
    "message": "There was an error"
}}
```

{% endtab %}

{% tab title="401 Likely wrong or missing API Key. " %}

```javascript
{
    "data": {},
    "status": 401,
    "message": "Not Authorized"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Something went wrong on our end. Email us the error at <dev@rareful.com>" %}

```javascript
{
    "status": 500,
    "message": "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Minting from a url is recommended for speed purposes. A potential flow would be to use the IPFS file upload route ahead of time to convert regular files to decentralized ones, and then use the mintFromUrl route for the minting
{% endhint %}
