Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not clear which API endpoint from OpenSea to use. #22

Open
tesla809 opened this issue Oct 23, 2023 · 0 comments
Open

Not clear which API endpoint from OpenSea to use. #22

tesla809 opened this issue Oct 23, 2023 · 0 comments

Comments

@tesla809
Copy link

Describe the bug

It is not clear which API end point to choose from. Upon using: https://api.opensea.io/api/v2/chain/ethereum/account/ from https://docs.opensea.io/reference/list_nfts_by_account

To Reproduce

const { FetchNFTClient } = require("@audius/fetch-nft");
const API_KEY = "SOME KEY";

// Open Sea Config
const openSeaConfig = {
 // is this the correct end point? It was taken from OpenSea docs, yet it does not resolve.
  apiEndpoint: "https://api.opensea.io/api/v2/chain/ethereum/account/",
  apiKey: API_KEY,
  assetLimit: 100,
  eventLimit: 300,
};

// Initialize fetch client with configs
const fetchClient = new FetchNFTClient({ openSeaConfig });

/*
  // Fetching all collectibles for the given wallets
  const solAssets = fetchClient
    .getCollectibles({
      solWallets: ["GrWNH9qfwrvoCEoTm65hmnSh4z3CD96SfhtfQY6ZKUfY"],
    })
    .then((res) => console.log(JSON.stringify(res, null, 2)));
*/

// Fetching Ethereum collectibles for the given wallets
fetchClient
  .getEthereumCollectibles(["0x5a8443f456f490dceead0922b0cc89afd598cec9"])
  .then((res) => console.log(res))
  .then(() => console.log("--------------"));

After running the script

node fetchNft.ts

nothing is returned:

{}
--------------

Supporting Media

See above

Expected behavior

It is expected to get the JSON data from the Ethereum based asset, just like the Solana based asset.

Your environment

OS: MacOS 13.4 - Ventura
Node version: V20.5.0
Npm version: 9.8.1
Browser name and version: Chrome 118.0.5993.70

Additional context:

When using the OpenSea API from the following website, the correct NFTs are returned:
https://docs.opensea.io/reference/list_nfts_by_account

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant