Polygon assets access
Hey, I'm trying to get info about this item: https://opensea.io/assets/matic/0xa02d547512bb90002807499f05495fe9c4c3943f/0
My code:
const data = await seaport.api.getAsset({
tokenAddress: '0xa02d547512bb90002807499f05495fe9c4c3943f',
tokenId: 0
});
My request URL is: https://api.opensea.io/api/v1/asset/0xa02d547512bb90002807499f05495fe9c4c3943f/0/? which is not exist.
I believe the problem is that it doesn't have matic keyword in params, can someone tell me how can I specified it?
hey @andkoval. Did you solve this issue? Could you share the solution?
I found this on OpenSea discord:
we plan to build in API support for Matic, but it’s not currently available.
We don’t currently have a REST API for Matic assets/events. You might be hitting our GraphQL endpoints - which is what our app hits to get that information - most of those endpoints are not auth-gated so can be called by other apps/teams
@krzysu any solution?
I've heard that they are working on a new version of API that will also support polygon, but I don't know how is it going. I'm not aware of any way to access opensea polygon assets or orders right now. Unfortunately :(
@krzysu Thanks for the reply. It seems there is no way to do it with opensea API but I'm using polygonscan API which is works but has a very limited amount of data it provides.
Would love to have an update on this.
Push OpenSea team to work intensively on this. https://support.opensea.io/hc/en-us/requests/new Let them know it's an important topic.
@krzysu Thanks for the reply. It seems there is no way to do it with opensea API but I'm using polygonscan API which is works but has a very limited amount of data it provides.
Could you by any chance give an example of how you do that? I have the same problem...
+1, I noticed that /events work with matic, but not /assets nor /asset
+1 for this, refresh api not working with Polygon
@decentraliser can you give a bit of info how you got those events to work? I tried with a polygon contract address
path: '/api/v1/events?asset_contract_address=0xa5f1ea7df861952863df2e8d1312f7305dabf215&offset=0&limit=10',
but get a 500 error back. replacing with any normal eth mainnet contract works fine.
I also tried /v2 and adding /matic in the URL without luck, keen to know what route you found...
@dscan it just worked out of the box for me, with the emblem-vault-matic contract
@decentraliser
hmm doesn't work for me, maybe I'm calling the API in a different way? I had problems with their node SDK, so I'm just using a raw axios/REST call as below. I have an API key, vis:
collection: https://opensea.io/collection/emblem-vault-matic token: https://opensea.io/assets/matic/0x8b8407c6184f1f0fd1082e83d6a3b8349caced12/688217 contract: https://polygonscan.com/address/0x8b8407c6184f1f0fd1082e83d6a3b8349caced12
osapi GET URL:
/api/v1/events?asset_contract_address=0x8b8407c6184f1f0fd1082e83d6a3b8349caced12&offset=0&limit=10
const osApiKey = AppConfig.getenv('osApiKey')
const options = {
headers: { Accept: 'application/json', 'X-API-KEY': osApiKey },
params: {}
};
export class Listing {
static async getListings(address?: string) {
const baseUri = `https://api.opensea.io/api/v1/events`
const asset_contract_address = '0x8b8407c6184f1f0fd1082e83d6a3b8349caced12' // emblem
// const asset_contract_address = '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d' // bayc
options.params = {
asset_contract_address,
// only_opensea: false,
// order_direction: 'desc',
offset: 0,
limit: 10
}
const result: AxiosResponse | void = await axios.get(baseUri, options).catch(err => {
console.log('axios err', err)
})
return result?.data
}
}
the BAYC contract (eth) works fine, but nothing i've tried on polygon works...
/events is actually the main API i'd like a response from
@dcsan it works when using the collection slug in the request params, as opposed to the contract address
Would love an update on this. Any news is appreciated :)
Is Matic Supported already ?
Any updates?
I hope OpenSea will update API support for polygon soon
I hope OpenSea will update API support for polygon and mumbai soon as well.
I hope OpenSea will update API support for polygon and mumbai soon as well.