> For the complete documentation index, see [llms.txt](https://banksea-finance.gitbook.io/banksea-oracle-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://banksea-finance.gitbook.io/banksea-oracle-api/oracle/ethereum-oracle.md).

# ETHEREUM ORACLE

### Get NFT collection floor price <a href="#huo-qu-yu-suan-ke-mu-v2" id="huo-qu-yu-suan-ke-mu-v2"></a>

```
## Request
curl -X 'GET' \
  'https://oracle-api.banksea.finance/nft/v1/eth/floor_price/current_status?collection=0x08D7C0242953446436F34b4C78Fe9da38c73668d&apikey=test-api-key' \
  -H 'accept: application/json'
```

* Interface: /nft/v1/eth/floor\_price/current\_status
* Method: GET
* Data Format: JSON
* Request Parameter:

| Parameter  | Type   | Required | Description         |
| ---------- | ------ | -------- | ------------------- |
| collection | String | Y        | The NFT collection. |
| apikey     | String | Y        | apikey              |

* Request Example:

  ```
  https://oracle-api.banksea.finance/nft/v1/eth/floor_price/current_status?collection=0x08D7C0242953446436F34b4C78Fe9da38c73668d&apikey=test-api-key
  ```
* Response Data:

| Field        | Type   | Description      |
| ------------ | ------ | ---------------- |
| floor\_price | Number | The floor price. |
| timestamp    | Number | timestamp        |

* Response Example:

  ```
  {
      "success": true,
      "code": "200",
      "message": "success",
      "data": {
          "timestamp": 1667741477,
          "floor_price": 38.0000
      }
  }
  ```

### Make HTTP GET requests from smart contracts using Chainlink <a href="#huo-qu-yu-suan-ke-mu-v2" id="huo-qu-yu-suan-ke-mu-v2"></a>

To make HTTP GET requests from smart contract using Chainlink. Learn about how to connect API to Chainlink, please refer to [Chainlink Any API Documentation | Chainlink Documentation](https://docs.chain.link/any-api/introduction)

Get the reference code from our repo:

```
git clone https://github.com/Banksea-Finance/banksea-chainlink-api-demo
```

The request parameters of the reference code are fixed, you can modify the code according to your own requirements.

```
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
import "@chainlink/contracts/src/v0.8/ConfirmedOwner.sol";

contract APIConsumer is ChainlinkClient, ConfirmedOwner {
    using Chainlink for Chainlink.Request;

    uint256 public floor;
    bytes32 private jobId;
    uint256 private fee;

    event fillFloor(bytes32 indexed requestId, uint256 floor);

    /**
     * @notice Initialize the link token and target oracle
     *
     * Rinkeby Goerli details:
     * Link Token: 0x326C977E6efc84E512bB9C30f76E30c160eD06FB
     * Oracle: 0xCC79157eb46F5624204f47AB42b3906cAA40eaB7 (Chainlink DevRel)
     * jobId: ca98366cc7314957b8c012c72f05aeeb
     *
     */
    constructor() ConfirmedOwner(msg.sender) {
        setChainlinkToken(0x326C977E6efc84E512bB9C30f76E30c160eD06FB);
        setChainlinkOracle(0xCC79157eb46F5624204f47AB42b3906cAA40eaB7);
        jobId = "ca98366cc7314957b8c012c72f05aeeb";
        fee = (1 * LINK_DIVISIBILITY) / 10; // 0,1 * 10**18 (Varies by network and job)
    }

    /**
     * Create a Chainlink request to retrieve API response, find the target
     * data, then multiply by 1000000000000000000 (to remove decimal places from data).
     */
    function requestFloor() public returns (bytes32 requestId) {
        Chainlink.Request memory req = buildChainlinkRequest(
            jobId,
            address(this),
            this.fulfill.selector
        );

        // Set the URL to perform the GET request on
        req.add(
            "get",
            "https://oracle-api.banksea.finance/nft/v1/eth/floor_price/current_status?collection=0x08D7C0242953446436F34b4C78Fe9da38c73668d&apikey=test-api-key"
        );

        req.add("path", "data,floor_price"); 

        // Multiply the result by 1000000000000000000 to remove decimals
        int256 timesAmount = 10 ** 18;
        req.addInt("times", timesAmount);

        // Sends the request
        return sendChainlinkRequest(req, fee);
    }

    /**
     * Receive the response in the form of uint256
     */
    function fulfill(
        bytes32 _requestId,
        uint256 _floor
    ) public recordChainlinkFulfillment(_requestId) {
        emit fillFloor(_requestId, _floor);
        floor = _floor;
    }

    /**
     * Allow withdraw of Link tokens from the contract
     */
    function withdrawLink() public onlyOwner {
        LinkTokenInterface link = LinkTokenInterface(chainlinkTokenAddress());
        require(
            link.transfer(msg.sender, link.balanceOf(address(this))),
            "Unable to transfer"
        );
    }
}
```

Install dependencies:

```
npm install
```

Create a .env file, and fill it with the privatekey of your wallet and infura key:

```
PRIVATE_KEY=YOUR-PRIVATE-KEY
INFURA_KEY=YOUR-INFURA-KEY
```

Compile the contract:

```
npx hardhat compile
```

Deploy:

```
npx hardhat run .\scripts\deploy.ts --network goerli
```

Record the address of APIConsumer and fund some LINK to the address. You can call the **requestFloor** interface on the contract. After a while, you can check the **floor** value on it.

Refer to this contract on the Goerli testnet network:

```
https://goerli.etherscan.io/address/0x157afa2063741224ae22030d4fac9820a4c44bfc
```

### The list of supported NFT collections <a href="#huo-qu-yu-suan-ke-mu-v2" id="huo-qu-yu-suan-ke-mu-v2"></a>

| Name                                     | Collection                                 |
| ---------------------------------------- | ------------------------------------------ |
| The n project                            | 0x05a46f1E545526FB803FF974C790aCeA34D1f2D6 |
| PROOF Collective                         | 0x08D7C0242953446436F34b4C78Fe9da38c73668d |
| My Pet Hooligan                          | 0x09233d553058c2F42ba751C87816a8E9FaE7Ef10 |
| Robotos                                  | 0x099689220846644F87D1137665CDED7BF3422747 |
| JRNY CLUB OFFICIAL                       | 0x0b4B2bA334f476C8F41bFe52A428D6891755554d |
| Kaiju Kingz                              | 0x0c2E57EFddbA8c768147D1fdF9176a0A6EBd5d83 |
| THE SHIBOSHIS                            | 0x11450058d796B02EB53e65374be59cFf65d3FE7f |
| alien frens                              | 0x123b30E25973FeCd8354dd5f41Cc45A3065eF88C |
| GalacticApes                             | 0x12d2D1beD91c24f878F37E66bd829Ce7197e4d14 |
| HYPEBEARSCLUB.OFFICIAL                   | 0x14e0a1F310E2B7E321c91f58847e98b8C802f6eF |
| PXN: Ghost Divison                       | 0x160C404B2b49CBC3240055CEaEE026df1e8497A0 |
| Moonbirds Oddities                       | 0x1792a96E5668ad7C167ab804a100ce42395Ce54D |
| DEGEN TOONZ COLLECTION                   | 0x19b86299c21505cdf59cE63740B240A9C822b5E4 |
| CryptoMories                             | 0x1a2F71468F656E97c2F86541E57189F59951efe7 |
| Cool Cats NFT                            | 0x1A92f7381B9F03921564a437210bB9396471050C |
| Treeverse                                | 0x1B829B926a14634d36625e60165c0770C09D02b2 |
| CrypToadz by GREMPLIN                    | 0x1CB1A5e65610AEFF2551A50f76a87a7d3fB649C6 |
| Sneaky Vampire Syndicate                 | 0x219B8aB790dECC32444a6600971c7C3718252539 |
| Moonbirds                                | 0x23581767a106ae21c074b2276D25e5C3e136a68b |
| Frontier Game                            | 0x236672Ed575E1e479b8E101AEeb920F32361f6F9 |
| V1 CryptoPunks Wrapped                   | 0x282BDD42f4eb70e7A9D9F40c8fEA0825B7f68C5D |
| DeadFellaz                               | 0x2acAb3DEa77832C09420663b0E1cB386031bA17B |
| BEANZ Official                           | 0x306b1ea3ecdf94aB739F1910bbda052Ed4A9f949 |
| Impostors Genesis Aliens                 | 0x3110EF5f612208724CA51F5761A69081809F03B7 |
| Pixelmon - Generation 1                  | 0x32973908FaeE0Bf825A343000fE412ebE56F802A |
| Murakami.Flowers Seed                    | 0x341A1c534248966c4b6AFaD165B98DAED4B964ef |
| 888 inner circle                         | 0x36d30B3b85255473D27dd0F7fD8F35e36a9d6F06 |
| Quirkies Originals                       | 0x3903d4fFaAa700b62578a66e7a67Ba4cb67787f9 |
| The Potatoz                              | 0x39ee2c7b3cb80254225884ca001F57118C8f21B6 |
| 0N1Force                                 | 0x3bf2922f4520a8BA0c2eFC3D2a1539678DaD5e9D |
| SupDucks                                 | 0x3Fe1a4c1481c8351E91B64D5c398b159dE07cbc5 |
| Dooplicator                              | 0x466CFcD0525189b573E794F554b8A751279213Ac |
| Ragnarok Meta                            | 0x497a9A79e82e6fC0FF10a16f6F75e6fcd5aE65a8 |
| CLONE X - X TAKASHI MURAKAMI             | 0x49cF6f5d44E70224e2E23fDcdd2C053F30aDA28B |
| Arcade Land                              | 0x4a8C9D751EEAbc5521A68FB080DD7E72E46462aF |
| MURI by Haus                             | 0x4B61413D4392c806E6d0fF5Ee91E6073C21d6430 |
| HAPE Prime                               | 0x4Db1f25D3d98600140dfc18dEb7515Be5Bd293Af |
| Forgotten Runes Wizards Cult             | 0x521f9C7505005CFA19A8E5786a9c3c9c9F5e6f42 |
| CyberKongz                               | 0x57a204AA1042f6E66DD7730813f4024114d74f37 |
| Invisible Friends                        | 0x59468516a8259058baD1cA5F8f4BFF190d30E066 |
| Mutant Ape Yacht Club                    | 0x60E4d786628Fea6478F785A6d7e704777c86a7c6 |
| Space Doodles                            | 0x620b70123fB810F6C653DA7644b5dD0b6312e4D8 |
| We Are All Going to Die                  | 0x659A4BdaAaCc62d2bd9Cb18225D9C89b5B697A5A |
| Prime Ape Planet PAP                     | 0x6632a9d63E142F17a668064D41A21193b49B41a0 |
| PhantaBear                               | 0x67D9417C9C3c250f61A83C7e8658daC487B56B09 |
| NeoTokyo Outer Identities                | 0x698FbAACA64944376e2CDC4CAD86eaa91362cF54 |
| Killer GF                                | 0x6bE69b2A9B153737887CfcdCa7781eD1511C7e36 |
| MetaHero Universe: Generative Identities | 0x6dc6001535e15b9def7b0f6A20a2111dFA9454E2 |
| C-01 Official Collection                 | 0x6FD053BfF10512d743Fa36C859e49351a4920df6 |
| KIWAMI Genesis                           | 0x701A038aF4Bd0fc9b69A829DdcB2f61185a49568 |
| IO: Imaginary Ones                       | 0x716F29B8972D551294d9E02B3eb0fC1107FbF4aA |
| My Curio Cards                           | 0x73DA73EF3a6982109c4d5BDb0dB9dd3E3783f313 |
| Psychedelics Anonymous Genesis           | 0x75E95ba5997Eb235F40eCF8347cDb11F18ff640B |
| mfers                                    | 0x79FCDEF22feeD20eDDacbB2587640e45491b757f |
| Adam Bomb Squad                          | 0x7AB2352b1D2e185560494D5e577F9D3c238b78C5 |
| Meebits                                  | 0x7Bd29408f11D2bFC23c34f18275bBf23bB716Bc7 |
| Murakami.Flowers Official                | 0x7D8820FA92EB1584636f4F5b8515B5476B75171a |
| JUNGLE FREAKS BY TROSLEY                 | 0x7E6Bc952d4b4bD814853301bEe48E99891424de0 |
| CyberKongz VX                            | 0x7EA3Cca10668B8346aeC0bf1844A49e995527c8B |
| FULL SEND METACARD NFT                   | 0x7eCb204feD7e386386CAb46a1fcB823ec5067aD5 |
| Wolf Game                                | 0x7F36182DeE28c45dE6072a34D29855BaE76DBe2f |
| Chimpers                                 | 0x80336Ad7A747236ef41F47ed2C7641828a480BAA |
| Neo Tokyo Identities                     | 0x86357A19E5537A8Fba9A004E555713BC943a66C0 |
| RTFKT - MNLTH                            | 0x86825dFCa7A6224cfBd2DA48e85DF2fc3Aa7C4B1 |
| Cool Pets NFT                            | 0x86C10D10ECa1Fca9DAF87a279ABCcabe0063F247 |
| CyberBrokers                             | 0x892848074ddeA461A15f337250Da3ce55580CA85 |
| Lazy Lions                               | 0x8943C7bAC1914C9A7ABa750Bf2B6B09Fd21037E0 |
| Doodles                                  | 0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e |
| MekaVerse                                | 0x9A534628B4062E123cE7Ee2222ec20B86e16Ca8F |
| ZombieClub Token                         | 0x9c80777CAe192E5031c38A0d951C55730eCC3f5e |
| Galaxy-Eggs                              | 0xA08126f5E1ED91A635987071E6FF5EB2aEb67C48 |
| Worldwide Webb Land                      | 0xA1D4657e0E6507D5a94d06DA93E94dC7C8c44b51 |
| VeeFriends                               | 0xa3AEe8BcE55BEeA1951EF834b99f3Ac60d1ABeeB |
| Coolman's Universe                       | 0xa5C0Bd78D1667c13BFB403E2a3336871396713c5 |
| Akutars                                  | 0xaaD35C2DadbE77f97301617D82e661776c891Fa9 |
| MutantCats                               | 0xaAdBA140Ae5e4c8a9eF0Cc86EA3124b446e3E46A |
| Damien Hirst - The Currency              | 0xaaDc2D4261199ce24A4B0a57370c4FCf43BB60aa |
| Vox Collectibles                         | 0xad9Fd7cB4fC7A0fBCE08d64068f60CbDE22Ed34C |
| Lives of Asuna                           | 0xAf615B61448691fC3E4c61AE4F015d6e77b6CCa8 |
| 3Landers                                 | 0xb4d06d46A8285F4EC79Fd294F78a881799d8cEd9 |
| Boss Beauties                            | 0xB5C747561a185A146f83cFff25BdfD2455b31fF4 |
| Bored Ape Kennel Club                    | 0xba30E5F9Bb24caa003E9f2f0497Ad287FDF95623 |
| Bored Ape Yacht Club                     | 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D |
| goblintown.wtf                           | 0xbCe3781ae7Ca1a5e050Bd9C4c77369867eBc307e |
| Pudgy Penguins                           | 0xBd3531dA5CF5857e7CfAA92426877b022e612cf8 |
| NFT Worlds                               | 0xBD4455dA5929D5639EE098ABFaa3241e9ae111Af |
| CryptoSkulls                             | 0xc1Caf0C19A8AC28c41Fe59bA6c754e4b9bd54dE9 |
| Hashmasks                                | 0xC2C747E0F7004F9E8817Db2ca4997657a7746928 |
| Official Wrapped MoonCats (Acclimated)   | 0xc3f733ca98E0daD0386979Eb96fb1722A1A05E69 |
| CryptoBatz by Ozzy Osbourne              | 0xc8adFb4D437357D0A656D4e62fd9a6D22e401aa0 |
| Creature World NFT                       | 0xc92cedDfb8dd984A89fb494c376f9A48b999aAFc |
| tubby cats by tubby collective           | 0xCa7cA7BcC765F77339bE2d648BA53ce9c8a262bD |
| FLUF World                               | 0xCcc441ac31f02cD96C153DB6fd5Fe0a2F4e6A68d |
| dotdotdots                               | 0xcE25E60A89F200B1fA40f6c313047FFe386992c3 |
| Karafuru                                 | 0xd2F668a8461D6761115dAF8Aeb3cDf5F40C532C6 |
| Zipcy's SuperNormal                      | 0xd532b88607B1877Fe20c181CBa2550E3BbD6B31C |
| Lil' Heroes by Edgar Plans               | 0xD78b76Fcc33cd416dA9d3D42f72649a23D7AC647 |
| PREMINT Collector Pass - OFFICIAL        | 0xe0176bA60efddb29Cac5b15338C9962dAee9de0c |
| World of Women                           | 0xe785E82358879F061BC3dcAC6f0444462D4b5330 |
| Azuki                                    | 0xED5AF388653567Af2F388E6224dC7C4b3241C544 |
| Rumble Kong League                       | 0xEf0182dc0574cd5874494a120750FD222FdB909a |
| The Doge Pound                           | 0xF4ee95274741437636e748DdAc70818B4ED7d043 |
| Project NANOPASS                         | 0xf54cC94f1F2f5De012B6Aa51F1E7eBdc43Ef5afC |
| Capsule House                            | 0xfcB1315C4273954F74Cb16D5b663DBF479EEC62e |
| Creepz Genesis                           | 0xfE8C6d19365453D26af321D0e8c910428c23873F |
| Loot (for Adventurers)                   | 0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7 |
