Blockchain HTTP RPC

פרמיום
על ידי Crypto APIs | מְעוּדכָּן hace un mes | Data
פּוֹפּוּלָרִיוּת

9.3 / 10

חֶבִיוֹן

74ms

רמת שירות

100%

Health Check

N/A

תקרא אותי

curl

curl \
  -d '{"jsonrpc":"2.0", "method":"eth_blockNumber", "params":[], "id":1}' \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key:[Your API key]" \
  -H "X-RapidAPI-Host: blockchain-http-rpc1.p.rapidapi.com" \
  -X POST \
  https://blockchain-http-rpc1.p.rapidapi.com/api/polygon/mumbai

web3js integration

import Web3 from "web3";

const provider = new Web3.providers.HttpProvider(
  "https://blockchain-http-rpc1.p.rapidapi.com/api/polygon/mumbai",
  {
    headers: [
      {
        name: "X-RapidAPI-Key",
        value: "[Your API key]",
      },
      {
        name: "X-RapidAPI-Host",
        value: "blockchain-http-rpc1.p.rapidapi.com",
      },
    ],
  }
);

const web3 = new Web3(provider);
web3.eth.getBlockNumber().then(function (result) {
  console.log("[web3.js] Current block number: " + result);
});

ethersjs integration

import Web3 from "web3";
import { ethers } from "ethers";

const web3provider = new Web3.providers.HttpProvider(
  "https://blockchain-http-rpc1.p.rapidapi.com/api/polygon/mumbai",
  {
    headers: [
      {
        name: "X-RapidAPI-Key",
        value: "[Your API key]",
      },
      {
        name: "X-RapidAPI-Host",
        value: "blockchain-http-rpc1.p.rapidapi.com",
      },
    ],
  }
);

const provider = new ethers.providers.Web3Provider(web3provider);
provider.getBlockNumber().then(function (result) {
  console.log("[ethers.js] Current block number: " + result);
});
עוקבים: 0
יוצר API:
Rapid account: Crypto AP Is
Crypto APIs
cryptoapis
היכנס כדי לדרג את ה- API
דירוג: 5 - הצבעות: 1