0

I try to fetch the owner address of a NFT which sits in the Polygon Network from OpenSea.io! The problem is that the API from opensea does not support Polygon.

I use the owner address as part of a auth process with MetaMask but I cant figure out any way to get the address except with some type of website scraping tool which would be pretty quick and dirty.

Does anyone has an idea how could I get the owner address somehow from polygon? Here a test NFT from opensea: https://opensea.io/assets/matic/0x2953399124f0cbb46d2cbacd8a89cf0599974963/25867163425986018856889440957896213450322282376135695915897716851719840727041

Contract is: 0x2953399124f0cbb46d2cbacd8a89cf0599974963 Token ID: 25867163425986018856889440957896213450322282376135695915897716851719840727041

Thx for any tips and ideas in advance

Oliver
  • 647
  • 4
  • 20
  • You'd have to get the abi from polygonscan and call whatever method does that from web3 – pguardiario Oct 16 '21 at 01:13
  • Actually no web3 needed. It's simple curl/json calls of the Poliscan API. The problem is that the API does not support any open to get the owner address of a token id. At least i didn't find any open. I do have only contract and token id pairs. – Oliver Oct 17 '21 at 03:37
  • Hmm, I'm explaining how to do it... Feel free to ignore me I guess. – pguardiario Oct 17 '21 at 14:31
  • I am not sure what you are talking about. Where do I ignore anything? Polygonscan has an API that's correct, to use this API you don't need web3 in my opinion. But either way with the API from Polygonscan I did not find any option to fetch the owner of a specific token_id with the given contract and token_id. Correct me if I am wrong and not seeing things. – Oliver Oct 18 '21 at 15:10
  • Sorry, I'm talking about the abi of the contract (no typo). – pguardiario Oct 18 '21 at 22:11

1 Answers1

1

You can use the moralis sdk for this, checkout this doc -> https://deep-index.moralis.io/api-docs/#/token/getTokenIdOwners

You can get the API key by signing up on moralis and just try it out in the browser on the above link!

Devesh B
  • 11
  • 1