[See Description] Connect any API to your smart contract | Chainlink Engineering Tutorials
Why Ethereum Stack Exchange recommends it
Ethereum Stack Exchange answerers point people to it when they ask how a smart contract can get off-chain API data or how Chainlink oracles work.
Recommended by 2 people across 3 different months, 2020 to 2022.
What it is
An 8-minute Chainlink engineering tutorial showing how to pull data from an external API into a Solidity smart contract through a Chainlink oracle. It covers HTTP GET and POST requests and walks through the Remix code and the on-chain flow on an Ethereum testnet. The description notes that some details have since changed, such as the Ropsten testnet being retired and JSON parsing moving from periods to commas.
What people said
Recommends Emrah · 2020-11 · Ethereum Stack Exchange · on “How do oracle services interact with logs?”
If you want to get off-chain data through the API calls, the only way would be to use blockchain oracles. Chainlink is a good option to start with it. Oracle does not emit anything. Emit is a contract member in the sense will be triggered when a certain function executed. You can use it to get updates about your contract on your front-end application as well. Here is the how-to get data using HTTP GET request [LINK] . Once the oracle reads your API request, it will send the function back to your smart contract. This way, you don't need to request any more data from oracle. Chainlink also provides a video explanations if you prefer to watch. Here is a youtube link [this video]
Recommends Emrah · 2021-01 · Ethereum Stack Exchange · on “ChainLink oracles - are they free to use? Is there an oracle alternative onchain?”
No , they are not free. Each oracle service comes with a price. You can learn more about the services they offer and their prices from the following link [LINK] . For your specific search, you can go to this link [LINK] . If you like to learn more and prefer video, I suggest the following video [this video] .
Recommends aakash4dev · 2022-03 · Ethereum Stack Exchange · on “Smart contract - OpenWeatherMap API”
Yes, it's possible. Option 1: Easy but centralised You need Web3JS (or py or java etc.). Make a NodeJS file index.js , install web3 and axios (to call weather data), host index.js somewhere, and when temperature goes up or down, call smart contract function. Option 2 : hard but decentralised. use Oracles [LINK] It give right data for smart contracts. tutorial: [this video] API calling with solidity example: // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol"; contract APIConsumer is ChainlinkClient { using Chainlink for Chainlink.Request; uint256 public volume; address private oracle; bytes32 private jobId; uint256 private fee; constr
Cites JTCon · 2021-03 · Ethereum Stack Exchange · on “Make a GET Request over the Binance Smart Chain with a Chainlink Oracle”
I am trying to call to an BSC Oracle to make an HTTP request according this ChainLink example [this video] . In my example I am goin to use the BSC mainnet 56 and a other JobID obviously: My steps: I created the contract with this zenAPIs get request contract and jobID over the BSC Mainnet [LINK] : I deployed the contract to the BSC Mainnet. There was an error, but the contract seems created. The BSCScan transaction. [LINK] I funded the contract with ERC677 LINK and the BSC accepted it. (I used this Chainlink official swap for change the Binance sent links to my wallet: [LINK] ) I called the requestEthereumPrice() function and the BSC return OK. I get the "currentPrice" var and REMIX return this