getNFTs
Gets all NFTs currently owned by a given address
This endpoint is supported on the following chains and networks:
  • Ethereum: Mainnet, Rinkeby, Kovan, Goerli, Ropsten
  • Polygon: Mainnet and Mumbai
  • Flow: Mainnet and Testnet (see docs here)
To see chain support across all features, check out the feature matrix.

Parameters

  • owner: [string] address for NFT owner (can be in ENS format!)
  • pageKey: [string] (optional) UUID for pagination. If more results are available, a UUID pageKey will be returned in the response. Pass that UUID into pageKey to fetch the next 100 NFTs. NOTE: pageKeys expire after 10 minutes.
  • contractAddresses[]: [array of strings] (optional) array of contract addresses to filter the responses with. Max limit 20 contracts.
  • withMetadata: [boolean] true by default (optional); if boolean is set to true the query will include metadata for each returned token
    • For more information on NFT metadata structure, go to our NFT API FAQ.
  • filters[]: [array of ENUMS] (optional) array of filters (as string ENUMS) that will be applied to the query. NFTs that are match one or more of these filters will be excluded from the response.
    NOTE: This is a beta feature. Valid filter strings include:
    • "SPAM": NFTs that have been classified as spam. Spam classification has a wide range of criteria that includes but is not limited to emitting fake events and copying other well-known NFTs.
      • For more information on how we classify spam, go to our NFT API FAQ.
NOTE:
Setting thewithMetadataparameter tofalse will reduce payload size and may result in a faster API call.

NOTE on Pagination:

We paginate our responses with a default limit of 100 responses. We've chosen this number via thorough testing to determine the best balance of reliability and speed. In the future, you will be able to specify your own default size. If the owner has more than 100 nfts, we'll provide a pageKey you can include in the next request to return the remaining responses. This uses cursor based pagination with an idempotent result. This means if you provide one it serves as a static reference to the NFTs owned at time of the first call. This means if an owner acquires or transfers an NFT in between a paginated call, this will NOT be reflected.

Returns

(By default)
(withMetadata = false)

Returns (by default)

  • ownedNfts: list of objects that represent NFTs owned by the address. Max results per response = 100.
    • Object schema:
      • contract:
        • address: address of NFT contract
      • id:
        • tokenId: Id for NFT (hex)
        • tokenMetadata
          • tokenType: "ERC721" or "ERC1155"
      • balance: token balance
      • title: name of the NFT asset
      • description: brief human-readable description
      • tokenUri:
        • raw: uri representing the location of the NFT's original metadata blob. This is a backup for you to parse when the metadata field is not automatically populated.
        • gateway: public gateway uri for the raw uri above.
      • media [array of object] :
        • raw: uri representing the location of the NFT media asset. This is a backup for you to parse when the metadata field is not automatically populated.
        • gateway: public gateway uri for the raw asset above.
        NOTE: Where possible, Alchemy-hosted NFT media are used in the gateway field and feature a Cloudinary URL for faster loading times and can be configured for image re-sizing. For more info on using Alchemy-hosted media, see this doc.
      • metadata: relevant metadata for NFT contract. This is useful for viewing image url, traits, etc. without having to follow the metadata url in tokenUri to parse manually. NOTE: Not all metadata fields may be filled in if the provided NFT contract does not contain relevant information.
        • image: URL to the NFT asset image. Can be standard URLs pointing to images on conventional servers, IPFS, or Arweave. Most types of images (SVGs, PNGs, JPEGs, etc.) are supported by NFT marketplaces.
        • external_url: The image URL that appears alongside the asset image on NFT platforms.
        • background_color: Background color of the NFT item. Usually must be defined as a six-character hexadecimal.
        • nameName of the NFT asset.
        • description: human-readable description of the NFT asset. (Markdown is supported/rendered on OpenSea and other NFT platforms)
        • attributes: traits/attributes/characteristics for each NFT asset.
          For more info on NFT responses: check out the NFT API FAQ.​
  • pageKey : (optional) UUID for pagination - returned if there are more NFTs to fetch. Max NFTs per page = 100.
  • totalCount: total number of NFTs owned by the given address.
  • blockHash: the canonical head block hash of when your request was received
  • error: A string describing a particular reason that we were unable to fetch complete metadata for the NFT. See the Handling Errors section for a complete list of potential errors.
​
NOTE: To parse and view an NFT's media asset, use either the gateway URI within media objector theexternal_urlwithin metadataobject. Visit the FAQ for more info on IPFS gateways.

Returns (withMetadata = false)

  • ownedNfts: list of objects that represent NFTs owned by the address. Max results per response = 100.
    • Object schema:
      • contract:
        • address: address of NFT contract
      • id:
        • tokenId: Id for NFT (integer)
      • balance: token balance
  • pageKey : (optional) UUID for pagination - returned if there are more NFTs to fetch. Max NFTs per page = 100.
  • totalCount: total number of NFTs owned by the given address.
  • blockHash: the canonical head block hash of when your request was received
NOTE: We are working to support edge-case NFTs which don't conform to ERC721 or 1155 standards. As such, the totalCount and ownedNftsreported may not reflect certain NFTs that we do not current support. If you notice an NFT that our API does not currently support, please submit a feature request or reach out to us over Discord.

Examples

For an example request with pagination, see Request (with pagination).
For examples with contract filtering, see Request (with contract filtering).
The examples below is for Ethereum Mainnet. If you are using Polygon you'll need to use your polygon endpoint instead: https:/polygon-mainnet.g.alchemy.com/nft/v2/your-api-key/getNFTs...

Request

Alchemy SDK
Fetch (JS)
Axios (JS)
Postman
Curl
1
// Setup: npm install @alch/alchemy-sdk
2
// Github: https://github.com/alchemyplatform/alchemy-sdk-js
3
import { Network, initializeAlchemy, getNftsForOwner } from "@alch/alchemy-sdk";
4
​
5
// Optional Config object, but defaults to demo api-key and eth-mainnet.
6
const settings = {
7
apiKey: "demo", // Replace with your Alchemy API Key.
8
network: Network.ETH_MAINNET, // Replace with your network.
9
maxRetries: 10,
10
};
11
​
12
const alchemy = initializeAlchemy(settings);
13
​
14
// Print total NFT count returned in the response:
15
const nftsForOwner = await getNftsForOwner(alchemy, "0xshah.eth");
16
console.log(nftsForOwner);
Copied!
1
import fetch from 'node-fetch';
2
​
3
var requestOptions = {
4
method: 'GET',
5
redirect: 'follow'
6
};
7
​
8
const baseURL = "https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/";
9
const ownerAddr = "0xfae46f94ee7b2acb497cecaff6cff17f621c693d";
10
const fetchURL = `${baseURL}?owner=${ownerAddr}`;
11
​
12
fetch(fetchURL, requestOptions)
13
.then(response => response.json())
14
.then(response => JSON.stringify(response, null, 2))
15
.then(result => console.log(result))
16
.catch(error => console.log('error', error))
Copied!
1
import axios from 'axios';
2
​
3
// replace with your Alchemy api key
4
const apiKey = "demo";
5
const baseURL = `https://eth-mainnet.alchemyapi.io/nft/v2/${apiKey}/getNFTs/`;
6
// replace with the wallet address you want to query for NFTs
7
const ownerAddr = "0xfae46f94ee7b2acb497cecaff6cff17f621c693d";
8
​
9
var config = {
10
method: 'get',
11
url: `${baseURL}?owner=${ownerAddr}`
12
};
13
​
14
axios(config)
15
.then(response => console.log(JSON.stringify(response.data, null, 2)))
16
.catch(error => console.log(error));
Copied!
1
URL: https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0xfae46f94ee7b2acb497cecaff6cff17f621c693d
2
RequestType: GET
Copied!
1
curl 'https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0xfae46f94ee7b2acb497cecaff6cff17f621c693d'
Copied!
If you're having trouble running requests via the Alchemy SDK, Fetch, or Axios, please refer to: NFT API Quickstart Guide ​

Response (by default)

1
{
2
"ownedNfts": [
3
{
4
"contract": {
5
"address": "0x0beed7099af7514ccedf642cfea435731176fb02"
6
},
7
"id": {
8
"tokenId": "28",
9
"tokenMetadata": {
10
"tokenType": "ERC721"
11
}
12
},
13
"title": "DuskBreaker #28",
14
"description": "Breakers have the honor of serving humanity through their work on The Dusk. They are part of a select squad of 10,000 recruits who spend their days exploring a mysterious alien spaceship filled with friends, foes, and otherworldly technology.",
15
"tokenUri": {
16
"raw": "https://duskbreakers.gg/api/breakers/28",
17
"gateway": "https://duskbreakers.gg/api/breakers/28"
18
},
19
"media": [
20
{
21
"raw": "https://duskbreakers.gg/breaker_images/28.png",
22
"gateway": "https://duskbreakers.gg/breaker_images/28.png"
23
}
24
],
25
"metadata": {
26
"name": "DuskBreaker #28",
27
"description": "Breakers have the honor of serving humanity through their work on The Dusk. They are part of a select squad of 10,000 recruits who spend their days exploring a mysterious alien spaceship filled with friends, foes, and otherworldly technology.",
28
"image": "https://duskbreakers.gg/breaker_images/28.png",
29
"external_url": "https://duskbreakers.gg",
30
"attributes": [
31
{
32
"value": "Locust Rider Armor (Red)",
33
"trait_type": "Clothes"
34
},
35
......
36
{
37
"value": "Big Smile (Purple)",
38
"trait_type": "Mouth"
39
},
40
{
41
"value": "Yellow",
42
"trait_type": "Background"
43
}
44
]
45
},
46
"timeLastUpdated": "2022-02-16T22:52:54.719Z"
47
},
48
......
49
{
50
"contract": {
51
"address": "0x97597002980134bea46250aa0510c9b90d87a587"
52
},
53
"id": {
54
"tokenId": "5527",
55
"tokenMetadata": {
56
"tokenType": "ERC721"
57
}
58
},
59
"title": "Runner #5527",
60
"description": "Chain Runners are Mega City renegades 100% generated on chain.",
61
"tokenUri": {
62
"raw": "https://api.chainrunners.xyz/tokens/metadata/5527?dna=73247164192459371523281785218958151913554625578441142916970699984935810987041",
63
"gateway": "https://api.chainrunners.xyz/tokens/metadata/5527?dna=73247164192459371523281785218958151913554625578441142916970699984935810987041"
64
},
65
"media": [
66
{
67
"raw": "https://img.chainrunners.xyz/api/v1/tokens/png/5527",
68
"gateway": "https://img.chainrunners.xyz/api/v1/tokens/png/5527"
69
}
70
],
71
"metadata": {
72
"name": "Runner #5527",
73
"description": "Chain Runners are Mega City renegades 100% generated on chain.",
74
"image": "https://img.chainrunners.xyz/api/v1/tokens/png/5527",
75
"attributes": [
76
{
77
"value": "Purple Green Diag",
78
"trait_type": "Background"
79
},
80
{
81
"value": "Human",
82
"trait_type": "Race"
83
},
84
....
85
{
86
"value": "Cig",
87
"trait_type": "Mouth Accessory"
88
}
89
]
90
},
91
"timeLastUpdated": "2022-02-18T00:42:04.401Z"
92
}
93
],
94
"totalCount": 6,
95
"blockHash": "0xeb2d26af5b6175344a14091777535a2cb21c681665a734a8285f889981987630"
96
}
97
​
Copied!

Response (withMetadata = false)

1
{
2
"ownedNfts": [
3
{
4
"contract": {
5
"address": "0x0beed7099af7514ccedf642cfea435731176fb02"
6
},
7
"id": {
8
"tokenId": "0x000000000000000000000000000000000000000000000000000000000000001c"
9
},
10
},
11
{
12
"contract": {
13
"address": "0x0beed7099af7514ccedf642cfea435731176fb02"
14
},
15
"id": {
16
"tokenId": "0x000000000000000000000000000000000000000000000000000000000000001d"
17
},
18
"balance": "1"
19
},
20
......
21
{
22
"contract": {
23
"address": "0x97597002980134bea46250aa0510c9b90d87a587"
24
},
25
"id": {
26
"tokenId": "0x0000000000000000000000000000000000000000000000000000000000001597"
27
},
28
"balance": "1"
29
}
30
],
31
"totalCount": 6,
32
"blockHash": "0xf9a2a4e15116680e22b160c734529f62d89d54cde0759daf5135672fad0ecebc"
33
}
Copied!

Request (with contract filtering)

Only one contract in filter array:
Alchemy Web3.js
Fetch (JS)
Axios (JS)
Postman
Curl
1
// Installation: https://github.com/alchemyplatform/alchemy-web3
2
​
3
import { createAlchemyWeb3 } from "@alch/alchemy-web3";
4
​
5
// Using HTTPS
6
const web3 = createAlchemyWeb3(
7
"https://eth-mainnet.alchemyapi.io/nft/v2/demo",
8
);
9
​
10
const nfts = await web3.alchemy.getNfts({owner: "0xC33881b8FD07d71098b440fA8A3797886D831061", contractAddresses: ["0x39ed051a1a3a1703b5e0557b122ec18365dbc184"]})
11
​
12
console.log(nfts);
13
​
Copied!
1
import fetch from 'node-fetch';
2
​
3
var requestOptions = {
4
method: 'GET',
5
redirect: 'follow'
6
};
7
​
8
const baseURL = "https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/";
9
const ownerAddr = "0xcF3A24407aae7c87bd800c47928C5F20Cd4764D2";
10
const contractAddr = "0x34d77a17038491a2a9eaa6e690b7c7cd39fc8392";
11
const fetchURL = `${baseURL}?owner=${ownerAddr}&contractAddresses[]=${contractAddr}`;
12
​
13
fetch(fetchURL, requestOptions)
14
.then(response => response.json())
15
.then(response => JSON.stringify(response, null, 2))
16
.then(result => console.log(result))
17
.catch(error => console.log('error', error))
18
​
Copied!
1
import axios from 'axios';
2
​
3
// replace with your Alchemy api key
4
const apiKey = "demo";
5
const baseURL = `https://eth-mainnet.alchemyapi.io/nft/v2/${apiKey}/getNFTs/`;
6
// replace with the wallet address you want to query for NFTs
7
const ownerAddr = "0xcF3A24407aae7c87bd800c47928C5F20Cd4764D2";
8
const contractAddr = "0x34d77a17038491a2a9eaa6e690b7c7cd39fc8392";
9
​
10
var config = {
11
method: 'get',
12
url: `${baseURL}?owner=${ownerAddr}&contractAddresses[]=${contractAddr}`
13
};
14
​
15
axios(config)
16
.then(response => console.log(JSON.stringify(response.data, null, 2)))
17
.catch(error => console.log(error));
18
​
Copied!
1
URL: https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0xfAE46f94Ee7B2Acb497CEcAFf6Cff17F621c693D&contractAddresses[]=0x39ed051a1a3a1703b5e0557b122ec18365dbc184
2
RequestType: GET
Copied!
1
curl --location -g --request GET 'https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0xfAE46f94Ee7B2Acb497CEcAFf6Cff17F621c693D&contractAddresses[]=0x39ed051a1a3a1703b5e0557b122ec18365dbc184'
Copied!
Multiple contracts in filter array:
Alchemy Web3.js
Fetch (JS)
Axios (JS)
Postman
Curl
1
// Installation: https://github.com/alchemyplatform/alchemy-web3
2
​
3
import { createAlchemyWeb3 } from "@alch/alchemy-web3";
4
​
5
// Using HTTPS
6
const web3 = createAlchemyWeb3(
7
"https://eth-mainnet.g.alchemy.com/nft/v2/demo",
8
);
9
​
10
const nfts = await web3.alchemy.getNfts({owner: "0xC33881b8FD07d71098b440fA8A3797886D831061", contractAddresses: ["0x39ed051a1a3a1703b5e0557b122ec18365dbc184", "0x76be3b62873462d2142405439777e971754e8e77"]})
11
​
12
console.log(nfts);
13
​
Copied!
1
import fetch from 'node-fetch';
2
​
3
var requestOptions = {
4
method: 'GET',
5
redirect: 'follow'
6
};
7
​
8
const baseURL = "https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/";
9
const ownerAddr = "0xcF3A24407aae7c87bd800c47928C5F20Cd4764D2";
10
const contractAddrs = ["0x34d77a17038491a2a9eaa6e690b7c7cd39fc8392", "0x76be3b62873462d2142405439777e971754e8e77"];
11
const fetchURL = `${baseURL}?owner=${ownerAddr}&contractAddresses[]=${contractAddr[0]}&contractAddresses[]=${contractAddr[1]}`;
12
​
13
fetch(fetchURL, requestOptions)
14
.then(response => response.json())
15
.then(response => JSON.stringify(response, null, 2))
16
.then(result => console.log(result))
17
.catch(error => console.log('error', error))
18
​
Copied!
1
import axios from 'axios';
2
​
3
// replace with your Alchemy api key
4
const apiKey = "demo";
5
const baseURL = `https://eth-mainnet.alchemyapi.io/nft/v2/${apiKey}/getNFTs/`;
6
// replace with the wallet address you want to query for NFTs
7
const ownerAddr = "0xcF3A24407aae7c87bd800c47928C5F20Cd4764D2";
8
const contractAddrs = ["0x34d77a17038491a2a9eaa6e690b7c7cd39fc8392", "0x76be3b62873462d2142405439777e971754e8e77"];
9
​
10
var config = {
11
method: 'get',
12
url: `${baseURL}?owner=${ownerAddr}&contractAddresses[]=${contractAddrs[0]}&contractAddresses[]=${contractAddrs[1]}`
13
};
14
​
15
axios(config)
16
.then(response => console.log(JSON.stringify(response.data, null, 2)))
17
.catch(error => console.log(error));
18
​
Copied!
1
URL: https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0xcF3A24407aae7c87bd800c47928C5F20Cd4764D2&contractAddresses[]=0x34d77a17038491a2a9eaa6e690b7c7cd39fc8392&contractAddresses[]=0x76be3b62873462d2142405439777e971754e8e77
2
REQUEST: GET
Copied!
1
curl --location -g --request GET 'https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0xcF3A24407aae7c87bd800c47928C5F20Cd4764D2&contractAddresses[]=0x34d77a17038491a2a9eaa6e690b7c7cd39fc8392&contractAddresses[]=0x76be3b62873462d2142405439777e971754e8e77'
Copied!
If you're having trouble running requests via Alchemy Web3.js, Fetch, or Axios, please refer to: NFT API Quickstart Guide ​

Response (with contract filtering)

1
{
2
"ownedNfts": [
3
{
4
"contract": {
5
"address": "0x34d77a17038491a2a9eaa6e690b7c7cd39fc8392"
6
},
7
"id": {
8
"tokenId": "0x0000000000000000000000000000000000000000000000000000000000000277"
9
},
10
}
11
],
12
"totalCount": 1,
13
"blockHash": "0x3d8bca59c08e41f55d46ebbe738327eb12955cf280bd06ef7d40352919c188d8"
14
}
Copied!

Request (with pagination)

This example request will not return anything in the response since the pageKey expires after 10 minutes.
Alchemy Web3.js
Fetch (JS)
Axios (JS)
Postman
Curl
1
// Installation: https://github.com/alchemyplatform/alchemy-web3
2
​
3
import { createAlchemyWeb3 } from "@alch/alchemy-web3";
4
​
5
// Using HTTPS
6
const web3 = createAlchemyWeb3(
7
"https://eth-mainnet.alchemyapi.io/nft/v2/demo",
8
);
9
​
10
const nfts = await web3.alchemy.getNfts({owner: "0xC33881b8FD07d71098b440fA8A3797886D831061", pageKey:"12e032c5-ce4a-4389-8764-b980e1a17da8"})
11
​
12
console.log(nfts);
Copied!
1
import fetch from 'node-fetch';
2
​
3
var requestOptions = {
4
method: 'GET',
5
redirect: 'follow'
6
};
7
​
8
const baseURL = "https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/";
9
const ownerAddr = "0xfAE46f94Ee7B2Acb497CEcAFf6Cff17F621c693D";
10
const pageKey = "12e032c5-ce4a-4389-8764-b980e1a17da8";
11
const fetchURL = `${baseURL}?owner=${ownerAddr}?pageKey=${pageKey}`;
12
​
13
fetch(fetchURL, requestOptions)
14
.then(response => response.json())
15
.then(response => JSON.stringify(response, null, 2))
16
.then(result => console.log(result))
17
.catch(error => console.log('error', error))
18
​
Copied!
1
import axios from 'axios';
2
​
3
// replace with your Alchemy api key
4
const apiKey = "demo";
5
const baseURL = `https://eth-mainnet.alchemyapi.io/nft/v2/${apiKey}/getNFTs/`;
6
// replace with the wallet address you want to query for NFTs
7
const pageKey = "12e032c5-ce4a-4389-8764-b980e1a17da8";
8
const ownerAddr = "0xfAE46f94Ee7B2Acb497CEcAFf6Cff17F621c693D";
9
​
10
var config = {
11
method: 'get',
12
url: `${baseURL}?owner=${ownerAddr}?pageKey=${pageKey}`
13
};
14
​
15
axios(config)
16
.then(response => console.log(JSON.stringify(response.data, null, 2)))
17
.catch(error => console.log(error));
18
​
Copied!
1
URL: https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0x8e7644918b3e280fb3b599ca381a4efcb7ade201&pageKey=12e032c5-ce4a-4389-8764-b980e1a17da8
Copied!
1
curl 'https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0x8e7644918b3e280fb3b599ca381a4efcb7ade201&pageKey=12e032c5-ce4a-4389-8764-b980e1a17da8'
Copied!
If you're having trouble running requests via Alchemy Web3.js, Fetch, or Axios, please refer to: NFT API Quickstart Guide ​

Response (with pagination)

1
{
2
"ownedNfts": [{
3
"contract": {
4
"address": "0x97597002980134bea46250aa0510c9b90d87a587"
5
},
6
"id": {
7
"tokenId": "0x00000000000000000000000000000000000000000000000000000000000009cb"
8
}
9
}, {
10
"contract": {
11
"address": "0x97597002980134bea46250aa0510c9b90d87a587"
12
},
13
"id": {
14
"tokenId": "0x00000000000000000000000000000000000000000000000000000000000009cc"
15
}
16
}, {
17
"contract": {
18
"address": "0x5ab21ec0bfa0b29545230395e3adaca7d552c948"
19
},
20
"id": {
21
"tokenId": "0x00000000000000000000000000000000000000000000000000000000000006dc"
22
}
23
}, {
24
"contract": {
25
"address": "0x3b3ee1931dc30c1957379fac9aba94d1c48a5405"
26
},
27
"id": {
28
"tokenId": "0x000000000000000000000000000000000000000000000000000000000000001a"
29
}
30
}, {
31
"contract": {
32
"address": "0x69c40e500b84660cb2ab09cb9614fa2387f95f64"
33
},
34
"id": {
35
"tokenId": "0x0000000000000000000000000000000000000000000000000000000000000391"
36
}
37
}, {
38
"contract": {
39
"address": "0x97597002980134bea46250aa0510c9b90d87a587"
40
},
41
"id": {
42
"tokenId": "0x00000000000000000000000000000000000000000000000000000000000008d5"
43
}
44
}, {
45
"contract": {
46
"address": "0x97597002980134bea46250aa0510c9b90d87a587"
47
},
48
"id": {
49
"tokenId": "0x0000000000000000000000000000000000000000000000000000000000000a1d"
50
}
51
}, {
52
"contract": {
53
"address": "0x97597002980134bea46250aa0510c9b90d87a587"
54
},
55
"id": {
56
"tokenId": "0x000000000000000000000000000000000000000000000000000000000000002a"
57
}
58
}, {
59
"contract": {
60
"address": "0x97597002980134bea46250aa0510c9b90d87a587"
61
},
62
"id": {
63
"tokenId": "0x000000000000000000000000000000000000000000000000000000000000038e"
64
}
65
}, {
66
"contract": {
67
"address": "0x97597002980134bea46250aa0510c9b90d87a587"
68
},
69
"id": {
70
"tokenId": "0x000000000000000000000000000000000000000000000000000000000000244b"
71
}
72
}],
73
"pageKey": "88434286-7eaa-472d-8739-32a0497c2a18",
74
"totalCount": 277,
75
"blockHash": "0x94d5ab52b8a6571733f6b183ef89f31573b82a4e78f8129b0ce90ef0beaf208b"
76
}
Copied!
​

Request (with filters)

Alchemy Web3.js
FetchJS
Axios
Postman
Curl
1
// Installation: https://github.com/alchemyplatform/alchemy-web3
2
​
3
import { createAlchemyWeb3 } from "@alch/alchemy-web3";
4
​
5
// Using HTTPS
6
const web3 = createAlchemyWeb3(
7
"https://eth-mainnet.alchemyapi.io/nft/v2/demo",
8
);
9
​
10
const nfts = await web3.alchemy.getNfts({owner: "0xC33881b8FD07d71098b440fA8A3797886D831061", "filters[]":"SPAM"})
11
​
12
console.log(nfts);
Copied!
1
import fetch from 'node-fetch';
2
​
3
var requestOptions = {
4
method: 'GET',java
5
redirect: 'follow'
6
};
7
​
8
const baseURL = "https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/";
9
const ownerAddr = "0xfAE46f94Ee7B2Acb497CEcAFf6Cff17F621c693D";
10
const fetchURL = `${baseURL}?owner=${ownerAddr}?filters[]=SPAM`;
11
​
12
fetch(fetchURL, requestOptions)
13
.then(response => response.json())
14
.then(response => JSON.stringify(response, null, 2))
15
.then(result => console.log(result))
16
.catch(error => console.log('error', error))
17
​
Copied!
1
import axios from 'axios';
2
​
3
// replace with your Alchemy api key
4
const apiKey = "demo";
5
const baseURL = `https://eth-mainnet.alchemyapi.io/nft/v2/${apiKey}/getNFTs/`;
6
// replace with the wallet address you want to query for NFTs
7
const ownerAddr = "0xfAE46f94Ee7B2Acb497CEcAFf6Cff17F621c693D";
8
​
9
var config = {
10
method: 'get',
11
url: `${baseURL}?owner=${ownerAddr}?filters[]=SPAM`
12
};
13
​
14
axios(config)
15
.then(response => console.log(JSON.stringify(response.data, null, 2)))
16
.catch(error => console.log(error));
17
​
Copied!
1
URL: https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0x8e7644918b3e280fb3b599ca381a4efcb7ade201&filters[]=SPAM
Copied!
​
1
curl 'https://eth-mainnet.alchemyapi.io/nft/v2/demo/getNFTs/?owner=0x8e7644918b3e280fb3b599ca381a4efcb7ade201&filters[]=SPAM'
Copied!
​