Scikit Web

NFT - OpenSea API 사용하기 본문

기타

NFT - OpenSea API 사용하기

Keun0 2022. 6. 7. 20:41
728x90
반응형

NFT기반의 이미지 또는 GIF 등의 객체를 만들어 보면 OpenSea 라는 사이트에 대해서 들어보게 될 것입니다.

https://opensea.io/

 

OpenSea, the largest NFT marketplace

A gas-free marketplace for NFTs on Polygon. Create, buy, sell, and auction NFTs on the Polygon blockchain without paying any gas fees. Browse popular no-gas fees NFTs.

opensea.io

 

해당 서비스는 클레이튼, 이더리움, 솔라나 기반으로 NFT Minting 된 객체들을 Scan 등의 기능을 이용하여 한눈에 보여주는 서비스 입니다.

 

해당 서비스에서는 자체적으로 개발한 SDK 와  API 를 제공해주고 있습니다.

https://docs.opensea.io/reference/api-overview 

 

API Overview

The OpenSea API helps developers build new experiences using NFTs and our marketplace data. We provide a set of endpoints that enable you to fetch ERC721 and ERC1155 token metadata as well as other core aspects of our marketplace, including events, collect

docs.opensea.io

 

권장하는 방법은 해당 서비스에서 제공해주는 SDK 와 API를 사용하는 것이지만..

 

오픈씨의 API는 웹 브라우저에서 동작하는 것을 확인 할 수 있습니다.

 

API Request 정보를 웹 브라우저 처럼 수정하여 요청하면 API를 사용할 수 있습니다.

 

추가적으로 jQuery Ajax 에서는 별도의 설정 없이 API 가 불러와지는 것을 확인하였습니다.

$.ajax({
    type: "GET",
    url: 'https://api.opensea.io/api/v1/assets',
    success: function (respData, textStatus, jqXHR) {
      console.log(respData);
    },
    error: function (xhr, status, error) {
      console.log(error);
    },
  });

 

728x90
반응형
Comments