Optimism Sepolia Testnet Chainlink Oracle Jobs
Optimism Sepolia is the testnet of Layer 2 rollup chain Optimism mainnet, and uses Ethereum's Sepolia testnet network as its Layer 1 protocol. Testnet ETH is used to pay for transactions on Optimism. Use the Optimism Bridge to transfer testnet ETH and LINK from Ethereum Sepolia to Optimistim Sepolia. Testnet LINK is available at faucets.chain.link.
The below documentation illustrates how to integrate a custom Chainlink data feed for your smart contract or dApp running on the Optimism Sepolia network. All testnet data feeds are free to use, and do not require you to fund your contracts with the LINK token. If you run into any trouble, head on over to our Discord server for the fastest assistance, or feel free to contact us here.
Looking for a custom price feed?
We can update any of your contract's data at a set frequency, and/or deviation-based trigger condition. Fill out our request survey to get this set up - we'll typically deliver your new feed to you in 24 hours or less!
Select the data type that you need:
- Uint256
- Uint256[]
- Int256
- Int256[]
- Bool
- Bool[]
- String (Bytes)
- String[] (Bytes[])
- Other...
What do you want to retrieve?
Data from the internet (HTTP request)
Retrieve a uint256
from the internet
This on-demand job initiates an HTTP GET
, POST
, PUT
, or DELETE
request to the internet, optionally parses a JSON-based response body for a numeric value at the given path, multiplies this value by the given multiplier, and returns the resulting 256-bit unsigned integer (uint256) to your smart contract.
This job writes a single uint256 object to your contract, which can store any integer from 0
to 115792089237316195423570985008687907853269984665640564039457584007913129639935
((2 ^ 256) - 1
).
Request metadata
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | a8356f48569c434eaa4ac5fcb4db5cc0 | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
method | string | 'POST' | The HTTP method to use in initiating your request for data (GET , POST , PUT , or DELETE ). |
url | string | 'https://myRequestURL.com/path?var1=abc&var2=xyz' | The URL to which to send your HTTP request for data. |
headers | string | '["my-header-1", "header 1 value", "my-header-2", "header 2 value"]' | An array of headers to send with the HTTP request, represented as an even-numbered array of strings. If no headers are desired, you must pass an empty string (''). |
body | string | 'My request body' | A body to send with the HTTP request (POST , PUT requests only). If no body is desired or applicable, you must pass an empty string (''). |
path | string | 'data,0,val' | The JSON Path at which to extract the result returned by the requested HTTP endpoint (JSON results only). To return the full result without parsing, you must pass an empty string (''). If the provided path cannot be found in the response, the request will not be fulfilled. |
multiplier | int256 | 10 ** 18 | The number by which to multiply the result returned to the contract. This is important, as Solidity cannot handle decimal objects. If no multiplication is desired, enter 1. If the result cannot be multiplied (ie, it is not a number), the request will not be fulfilled. |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need to send sensitive information?
Data entered into a smart contract is visible to the general public.
If you need to send sensitive information along with your HTTP request (ie, an API key), you can instead store this information off-chain on our secure infrastructure. Please fill out our Request Survey to get started, and specify within the notes that you'd like us to store your API key for you - once we receive your information, we'll provide you with a custom job ID that will send your sensitive data safely along with your request.
Troubleshooting
Having trouble with your request? Check our Chainlink Direct Requests FAQ.
This job has a configured gas limit of 1,000,000 for writing your result on-chain. If your transaction isn't returning any value after more than 60 seconds of waiting, click the above 'Oracle Address' for this job to see if any recent transaction(s) have failed due to an 'out of gas' error. If so, you'll need to either A) Return a smaller response, B) Split your request into multiple oracle transactions, or C) Contact us to request a higher gas allowance for your specific use case (may result in higher job pricing).
Still need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Simulating the above request logic
Let's walk through each step of the above sample request, to better understand how it all works together:
1. Send the HTTP request:
The following curl
command simulates the same HTTP request that our Chainlink node makes shortly after you trigger the request()
function within your consumer contract:
curl 'https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH&tsyms=USD,EUR' \
--request 'GET' \
--header 'content-type: application/json' \
--header 'set-cookie: sid=14A52'
2. Analyze the response:
The following is a sample response body returned to our Chainlink node by the above HTTP request (abbreviated for clarity):
{
"BTC":{
"USD":30575.12,
"EUR":27810.9
},
"ETH":{
"USD":1875.87,
"EUR":1706.29
}
}
3. Apply the JSON path:
After receiving the above sample response, our Chainlink node will attempt to filter the result by the provided path
parameter value (ETH,USD
). After applying the provided path, we get the following result:
1875.87
4. Apply the multiplier:
After filtering the sample response by the provided JSON path, our Chainlink node will multiply the result by the provided multiplier
parameter value (10 ** 18
). After applying this multiplier, we get the following value, which is ultimately written to your smart contract as a uint256
object by our Chainlink oracle:
1875870000000000000000
A random number (VRF / RNG)
Retrieve a random uint256
number (VRF / RNG)
This on-demand job initiates an oracle request for a random number within the specified range, and returns the resulting 256-bit unsigned integer (uint256) to your smart contract.
TIP: Need to retrieve multiple random numbers at once? Check out our uint256[] or int256[] jobs instead.
This job writes a single uint256 object to your contract, which can store any integer from 0
to 115792089237316195423570985008687907853269984665640564039457584007913129639935
((2 ^ 256) - 1
).
Request metadata
You'll set the following attributes within your contract's constructor function (see below):
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 92b7c5a0307545d9ad032f00523605a0 | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
minVal | int256 | 0 | The lower bound of the desired random number range (inclusive). |
maxVal | int256 | 500 | The upper bound of the desired random number range (inclusive). |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Something else
Have a custom requirement?
We've got you covered:
- Fill out our Request Survey with the relevant details about your request.
- We'll assess your request and provide you with a custom job ID that works for you in 24 hours or less!
Join our Discord to get the fastest service for your request!
What do you want to retrieve?
Data from the internet (HTTP request)
Retrieve a uint256[]
from the internet
This on-demand job initiates an HTTP GET
, POST
, PUT
, or DELETE
request to the internet, optionally parses a JSON-based response body for an array of numeric value at the given path, multiplies each element in the array by the given multiplier, and returns the resulting array of 256-bit unsigned integers (uint256[]) to your smart contract.
This job writes a single uint256[] object to your contract, which can store an array of unsigned integers, each of whose values range from 0
to 115792089237316195423570985008687907853269984665640564039457584007913129639935
((2 ^ 256) - 1
).
Request metadata
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | e20c7567b2bb4e3690c615d03457b5d3 | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
method | string | 'GET' | The HTTP method to use in initiating your request for data (GET , POST , PUT , or DELETE ). |
url | string | 'https://myRequestURL.com/path?var1=abc&var2=xyz' | The URL to which to send your HTTP request for data. |
headers | string | '["my-header-1", "header 1 value", "my-header-2", "header 2 value"]' | An array of headers to send with the HTTP request, represented as an even-numbered array of strings. If no headers are desired, you must pass an empty string (''). |
body | string | 'My request body' | A body to send with the HTTP request (POST , PUT requests only). If no body is desired or applicable, you must pass an empty string (''). |
path | string | 'data,0,val;data,1,val;data,2,val' | A semicolon-delimited list of JSON Paths at which to extract data from the result returned by the requested HTTP endpoint (JSON results only). If a single path is desired, enter the path without any semicolons. The target of this singular path must be an array of numbers. If multiple paths are specified, the target of each requested path must be a singular number. An array (uint256[] ) will be returned containing the individual results of each path, with order preserved. If any of the provided path(s) cannot be found in the response, the request will not be fulfilled. To return the full result without any parsing (must be an array of numbers), you must pass an empty string (''). |
multiplier | int256 | 10 ** 18 | The number by which to multiply every element within the result array returned to the contract. This is important, as Solidity cannot handle decimal objects. If no multiplication is desired, enter 1. If the result cannot be multiplied (ie, all elements are not numbers), the request will not be fulfilled. |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need to send sensitive information?
Data entered into a smart contract is visible to the general public.
If you need to send sensitive information along with your HTTP request (ie, an API key), you can instead store this information off-chain on our secure infrastructure. Please fill out our Request Survey to get started, and specify within the notes that you'd like us to store your API key for you - once we receive your information, we'll provide you with a custom job ID that will send your sensitive data safely along with your request.
Troubleshooting
Having trouble with your request? Check our Chainlink Direct Requests FAQ.
This job has a configured gas limit of 1,000,000 for writing your result on-chain. If your transaction isn't returning any value after more than 60 seconds of waiting, click the above 'Oracle Address' for this job to see if any recent transaction(s) have failed due to an 'out of gas' error. If so, you'll need to either A) Return a smaller response, B) Split your request into multiple oracle transactions, or C) Contact us to request a higher gas allowance for your specific use case (may result in higher job pricing).
Still need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Simulating the above request logic
Let's walk through each step of the above sample request, to better understand how it all works together:
1. Send the HTTP request:
The following curl
command simulates the same HTTP request that our Chainlink node makes shortly after you trigger the request()
function within your consumer contract:
curl "https://httpbin.org/post" \
--request 'POST' \
--header 'content-type: application/json' \
--header 'set-cookie: sid=14A52' \
--data '{"data":[[12.43,54.47,98.34],[89.99,34.21,85.65],[412.43,983.89,473.31]]}'
2. Analyze the response:
The following is a sample response body returned to our Chainlink node by the above HTTP request (abbreviated for clarity):
{
"json":{
"data":[
[
12.43,
54.47,
98.34
],
[
89.99,
34.21,
85.65
],
[
412.43,
983.89,
473.31
]
]
}
}
3. Apply the JSON path:
After receiving the above sample response, our Chainlink node will attempt to filter the result by the provided path
parameter value (json,data,0,2;json,data,1,0;json,data,2,1
), which contains 3 separate (;
-delimited) JSON paths. After applying the provided path parameter, we get the following array:
[-54.47,89.89,983.89]
4. Apply the multiplier:
After filtering the sample response by the provided JSON path, our Chainlink node will multiply every element in the result array by the provided multiplier
parameter value (10 ** 18
). After applying this multiplier, we get the following array, which is ultimately written to your smart contract as a uint256[]
object by our Chainlink oracle:
[98340000000000000000,89990000000000000000,412430000000000000000]
Random numbers (VRF / RNG)
Retrieve a uint256[]
of random numbers (VRF / RNG)
This on-demand job initiates an oracle request for an array of random numbers within the specified range, and returns the resulting array of 256-bit unsigned integers (uint256[]) to your smart contract.
TIP: Need to retrieve a single random number instead? Check out our uint256 or int256 jobs instead.
This job writes a single uint256[] object to your contract, which can store an array of unsigned integers, each of whose values range from 0
to 115792089237316195423570985008687907853269984665640564039457584007913129639935
((2 ^ 256) - 1
).
Request metadata
You'll set the following attributes within your contract's constructor function (see below):
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 1b9b1967e5084cb59c2f04bcfc5307cb | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
minVal | int256 | 0 | The lower bound of the desired random number range (inclusive). |
maxVal | int256 | 500 | The upper bound of the desired random number range (inclusive). |
quantity | int256 | 5 | The number of random numbers to retrieve (ie, the uint256[] object length). |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Something else
Have a custom requirement?
We've got you covered:
- Fill out our Request Survey with the relevant details about your request.
- We'll assess your request and provide you with a custom job ID that works for you in 24 hours or less!
Join our Discord to get the fastest service for your request!
What do you want to retrieve?
Data from the internet (HTTP request)
Retrieve a int256
from the internet
This on-demand job initiates an HTTP GET
, POST
, PUT
, or DELETE
request to the internet, optionally parses a JSON-based response body for a numeric value at the given path, multiplies this value by the given multiplier, and returns the resulting 256-bit signed integer (int256) to your smart contract.
This job writes a single int256 object to your contract, which can store any integer from -2 ^ 255
to (2 ^ 255) - 1
.
Request metadata
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 7f221811c63d49dd98031f957bf9bce0 | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
method | string | 'POST' | The HTTP method to use in initiating your request for data (GET , POST , PUT , or DELETE ). |
url | string | 'https://myRequestURL.com/path?var1=abc&var2=xyz' | The URL to which to send your HTTP request for data. |
headers | string | '["my-header-1", "header 1 value", "my-header-2", "header 2 value"]' | An array of headers to send with the HTTP request, represented as an even-numbered array of strings. If no headers are desired, you must pass an empty string (''). |
body | string | 'My request body' | A body to send with the HTTP request (POST , PUT requests only). If no body is desired or applicable, you must pass an empty string (''). |
path | string | 'data,0,val' | The JSON Path at which to extract the result returned by the requested HTTP endpoint (JSON results only). To return the full result without parsing, you must pass an empty string (''). If the provided path cannot be found in the response, the request will not be fulfilled. |
multiplier | int256 | 10 ** 18 | The number by which to multiply the result returned to the contract. This is important, as Solidity cannot handle decimal objects. If no multiplication is desired, enter 1. If the result cannot be multiplied (ie, it is not a number), the request will not be fulfilled. |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need to send sensitive information?
Data entered into a smart contract is visible to the general public.
If you need to send sensitive information along with your HTTP request (ie, an API key), you can instead store this information off-chain on our secure infrastructure. Please fill out our Request Survey to get started, and specify within the notes that you'd like us to store your API key for you - once we receive your information, we'll provide you with a custom job ID that will send your sensitive data safely along with your request.
Troubleshooting
Having trouble with your request? Check our Chainlink Direct Requests FAQ.
This job has a configured gas limit of 1,000,000 for writing your result on-chain. If your transaction isn't returning any value after more than 60 seconds of waiting, click the above 'Oracle Address' for this job to see if any recent transaction(s) have failed due to an 'out of gas' error. If so, you'll need to either A) Return a smaller response, B) Split your request into multiple oracle transactions, or C) Contact us to request a higher gas allowance for your specific use case (may result in higher job pricing).
Still need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Simulating the above request logic
Let's walk through each step of the above sample request, to better understand how it all works together:
1. Send the HTTP request:
The following curl
command simulates the same HTTP request that our Chainlink node makes shortly after you trigger the request()
function within your consumer contract:
curl 'https://httpbin.org/post' \
--request 'POST' \
--header 'content-type: application/json' \
--header 'set-cookie: sid=14A52' \
--data '{"data":[[12.43,-54.47,98.34],[89.99,-34.21,-85.65],[-412.43,983.89,473.31]]}'
2. Analyze the response:
The following is a sample response body returned to our Chainlink node by the above HTTP request (abbreviated for clarity):
{
"json":{
"data":[
[
12.43,
-54.47,
98.34
],
[
89.99,
-34.21,
-85.65
],
[
-412.43,
983.89,
473.31
]
]
}
}
3. Apply the JSON path:
After receiving the above sample response, our Chainlink node will attempt to filter the result by the provided path
parameter value (json,data,1,2
). After applying the provided path, we get the following result:
-85.65
4. Apply the multiplier:
After filtering the sample response by the provided JSON path, our Chainlink node will multiply the result by the provided multiplier
parameter value (10 ** 18
). After applying this multiplier, we get the following value, which is ultimately written to your smart contract as a int256
object by our Chainlink oracle:
-85650000000000000000
A random number (VRF / RNG)
Retrieve a random int256
number (VRF / RNG)
This on-demand job initiates an oracle request for a random number within the specified range, and returns the resulting 256-bit signed integer (int256) to your smart contract.
TIP: Need to retrieve multiple random numbers at once? Check out our uint256[] or int256[] jobs instead.
This job writes a single int256 object to your contract, which can store any integer from -2 ^ 255
to (2 ^ 255) - 1
.
Request metadata
You'll set the following attributes within your contract's constructor function (see below):
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 0e58feb938b044b2a342639c10d9eef4 | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
minVal | int256 | -500 | The lower bound of the desired random number range (inclusive). |
maxVal | int256 | 500 | The upper bound of the desired random number range (inclusive). |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Something else
Have a custom requirement?
We've got you covered:
- Fill out our Request Survey with the relevant details about your request.
- We'll assess your request and provide you with a custom job ID that works for you in 24 hours or less!
Join our Discord to get the fastest service for your request!
What do you want to retrieve?
Data from the internet (HTTP request)
Retrieve a int256[]
from the internet
This on-demand job initiates an HTTP GET
, POST
, PUT
, or DELETE
request to the internet, optionally parses a JSON-based response body for an array of numeric value at the given path, multiplies each element in the array by the given multiplier, and returns the resulting array of 256-bit signed integers (int256[]) to your smart contract.
This job writes a single int256[] object to your contract, which can store an array of signed integers, each of whose values range from -2 ^ 255
to (2 ^ 255) - 1
.
Request metadata
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 356a0aced8f7425abd2ec17df9014359 | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
method | string | 'GET' | The HTTP method to use in initiating your request for data (GET , POST , PUT , or DELETE ). |
url | string | 'https://myRequestURL.com/path?var1=abc&var2=xyz' | The URL to which to send your HTTP request for data. |
headers | string | '["my-header-1", "header 1 value", "my-header-2", "header 2 value"]' | An array of headers to send with the HTTP request, represented as an even-numbered array of strings. If no headers are desired, you must pass an empty string (''). |
body | string | 'My request body' | A body to send with the HTTP request (POST , PUT requests only). If no body is desired or applicable, you must pass an empty string (''). |
path | string | 'data,0,val;data,1,val;data,2,val' | A semicolon-delimited list of JSON Paths at which to extract data from the result returned by the requested HTTP endpoint (JSON results only). If a single path is desired, enter the path without any semicolons. The target of this singular path must be an array of numbers. If multiple paths are specified, the target of each requested path must be a singular number. An array (int256[] ) will be returned containing the individual results of each path, with order preserved. If any of the provided path(s) cannot be found in the response, the request will not be fulfilled. To return the full result without any parsing (must be an array of numbers), you must pass an empty string (''). |
multiplier | int256 | 10 ** 18 | The number by which to multiply every element within the result array returned to the contract. This is important, as Solidity cannot handle decimal objects. If no multiplication is desired, enter 1. If the result cannot be multiplied (ie, all elements are not numbers), the request will not be fulfilled. |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need to send sensitive information?
Data entered into a smart contract is visible to the general public.
If you need to send sensitive information along with your HTTP request (ie, an API key), you can instead store this information off-chain on our secure infrastructure. Please fill out our Request Survey to get started, and specify within the notes that you'd like us to store your API key for you - once we receive your information, we'll provide you with a custom job ID that will send your sensitive data safely along with your request.
Troubleshooting
Having trouble with your request? Check our Chainlink Direct Requests FAQ.
This job has a configured gas limit of 1,000,000 for writing your result on-chain. If your transaction isn't returning any value after more than 60 seconds of waiting, click the above 'Oracle Address' for this job to see if any recent transaction(s) have failed due to an 'out of gas' error. If so, you'll need to either A) Return a smaller response, B) Split your request into multiple oracle transactions, or C) Contact us to request a higher gas allowance for your specific use case (may result in higher job pricing).
Still need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Simulating the above request logic
Let's walk through each step of the above sample request, to better understand how it all works together:
1. Send the HTTP request:
The following curl
command simulates the same HTTP request that our Chainlink node makes shortly after you trigger the request()
function within your consumer contract:
curl "https://httpbin.org/post" \
--request 'POST' \
--header 'content-type: application/json' \
--header 'set-cookie: sid=14A52' \
--data '{"data":[[12.43,-54.47,98.34],[89.99,-34.21,-85.65],[-412.43,983.89,473.31]]}'
2. Analyze the response:
The following is a sample response body returned to our Chainlink node by the above HTTP request (abbreviated for clarity):
{
"json":{
"data":[
[
12.43,
-54.47,
98.34
],
[
89.99,
-34.21,
-85.65
],
[
-412.43,
983.89,
473.31
]
]
}
}
3. Apply the JSON path:
After receiving the above sample response, our Chainlink node will attempt to filter the result by the provided path
parameter value (json,data,0,1;json,data,1,0;json,data,2,1
), which contains 3 separate (;
-delimited) JSON paths. After applying the provided path parameter, we get the following result:
[-54.47,89.89,983.89]
4. Apply the multiplier:
After filtering the sample response by the provided JSON path, our Chainlink node will multiply every element in the result array by the provided multiplier
parameter value (10 ** 18
). After applying this multiplier, we get the following array, which is ultimately written to your smart contract as a int256[]
object by our Chainlink oracle:
[-54470000000000000000,89990000000000000000,983890000000000000000]
Random numbers (VRF / RNG)
Retrieve a int256[]
of random numbers (VRF / RNG)
This on-demand job initiates an oracle request for an array of random numbers within the specified range, and returns the resulting array of 256-bit signed integers (int256[]) to your smart contract.
TIP: Need to retrieve a single random number instead? Check out our uint256 or int256 jobs instead.
This job writes a single int256[] object to your contract, which can store an array of signed integers, each of whose values range from -2 ^ 255
to (2 ^ 255) - 1
.
Request metadata
You'll set the following attributes within your contract's constructor function (see below):
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 6e8063b1ced54163aadddc5237c6d04e | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
minVal | int256 | -500 | The lower bound of the desired random number range (inclusive). |
maxVal | int256 | 500 | The upper bound of the desired random number range (inclusive). |
quantity | int256 | 5 | The number of random numbers to retrieve (ie, the int256[] object length). |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Something else
Have a custom requirement?
We've got you covered:
- Fill out our Request Survey with the relevant details about your request.
- We'll assess your request and provide you with a custom job ID that works for you in 24 hours or less!
Join our Discord to get the fastest service for your request!
What do you want to retrieve?
Data from the internet (HTTP request)
Retrieve a bool
from the internet
This on-demand job initiates an HTTP GET
, POST
, PUT
, or DELETE
request to the internet, optionally parses a JSON-based response body for a boolean value at the given path, and returns the resulting object (bool) to your smart contract.
This job writes a single bool object to your contract, which can store a true
or false
value.
Request metadata
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 43309009a154495cb2ed794233e6ff56 | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
method | string | 'GET' | The HTTP method to use in initiating your request for data (GET , POST , PUT , or DELETE ). |
url | string | 'https://myRequestURL.com/path?var1=abc&var2=xyz' | The URL to which to send your HTTP request for data. |
headers | string | '["my-header-1", "header 1 value", "my-header-2", "header 2 value"]' | An array of headers to send with the HTTP request, represented as an even-numbered array of strings. If no headers are desired, you must pass an empty string (''). |
body | string | 'My request body' | A body to send with the HTTP request (POST , PUT requests only). If no body is desired or applicable, you must pass an empty string (''). |
path | string | 'data,0,val' | The JSON Path at which to extract the result returned by the requested HTTP endpoint (JSON results only). To return the full result without parsing, you must pass an empty string (''). If the provided path cannot be found in the response, the request will not be fulfilled. |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need to send sensitive information?
Data entered into a smart contract is visible to the general public.
If you need to send sensitive information along with your HTTP request (ie, an API key), you can instead store this information off-chain on our secure infrastructure. Please fill out our Request Survey to get started, and specify within the notes that you'd like us to store your API key for you - once we receive your information, we'll provide you with a custom job ID that will send your sensitive data safely along with your request.
Troubleshooting
Having trouble with your request? Check our Chainlink Direct Requests FAQ.
This job has a configured gas limit of 1,000,000 for writing your result on-chain. If your transaction isn't returning any value after more than 60 seconds of waiting, click the above 'Oracle Address' for this job to see if any recent transaction(s) have failed due to an 'out of gas' error. If so, you'll need to either A) Return a smaller response, B) Split your request into multiple oracle transactions, or C) Contact us to request a higher gas allowance for your specific use case (may result in higher job pricing).
Still need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Simulating the above request logic
Let's walk through each step of the above sample request, to better understand how it all works together:
1. Send the HTTP request:
The following curl
command simulates the same HTTP request that our Chainlink node makes shortly after you trigger the request()
function within your consumer contract:
curl 'https://httpbin.org/post' \
--request 'POST' \
--header 'content-type: application/json' \
--header 'set-cookie: sid=14A52' \
--data '{"data":[{"coin":"BTC","isActive":false},{"coin":"ETH","isActive":false},{"coin":"LINK","isActive":true}]}'
2. Analyze the response:
The following is a sample response body returned to our Chainlink node by the above HTTP request (abbreviated for clarity):
{
"json":{
"data":[
{
"coin":"BTC",
"isActive":false
},
{
"coin":"ETH",
"isActive":false
},
{
"coin":"LINK",
"isActive":true
}
]
}
}
3. Apply the JSON path:
After receiving the above sample response, our Chainlink node will attempt to filter the result by the provided path
parameter value (json,data,2,isActive
). After applying the provided path, we get the following result, which is ultimately written to your smart contract as a bool
object by our Chainlink oracle:
true
Something else
Have a custom requirement?
We've got you covered:
- Fill out our Request Survey with the relevant details about your request.
- We'll assess your request and provide you with a custom job ID that works for you in 24 hours or less!
Join our Discord to get the fastest service for your request!
What do you want to retrieve?
Data from the internet (HTTP request)
Retrieve a bool[]
from the internet
This on-demand job initiates an HTTP GET
, POST
, PUT
, or DELETE
request to the internet, optionally parses a JSON-based response body for an array of boolean values at the given path, and returns the resulting array of booleans (bool[]) to your smart contract.
This job writes a single bool[] object to your contract, which can store an array of true
or false
values.
Request metadata
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 433ba6a76b374e2580dd43685a9de8c6 | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
method | string | 'GET' | The HTTP method to use in initiating your request for data (GET , POST , PUT , or DELETE ). |
url | string | 'https://myRequestURL.com/path?var1=abc&var2=xyz' | The URL to which to send your HTTP request for data. |
headers | string | '["my-header-1", "header 1 value", "my-header-2", "header 2 value"]' | An array of headers to send with the HTTP request, represented as an even-numbered array of strings. If no headers are desired, you must pass an empty string (''). |
body | string | 'My request body' | A body to send with the HTTP request (POST , PUT requests only). If no body is desired or applicable, you must pass an empty string (''). |
path | string | 'data,0,val;data,1,val;data,2,val' | A semicolon-delimited list of JSON Paths at which to extract data from the result returned by the requested HTTP endpoint (JSON results only). If a single path is desired, enter the path without any semicolons. The target of this singular path must be an array of boolean values (true or false ). If multiple paths are specified, the target of each requested path must be a singular boolean value. An array (bool[] ) will be returned containing the individual results of each path, with order preserved. If any of the provided path(s) cannot be found in the response, the request will not be fulfilled. To return the full result without any parsing (must be an array of boolean values), you must pass an empty string (''). |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need to send sensitive information?
Data entered into a smart contract is visible to the general public.
If you need to send sensitive information along with your HTTP request (ie, an API key), you can instead store this information off-chain on our secure infrastructure. Please fill out our Request Survey to get started, and specify within the notes that you'd like us to store your API key for you - once we receive your information, we'll provide you with a custom job ID that will send your sensitive data safely along with your request.
Troubleshooting
Having trouble with your request? Check our Chainlink Direct Requests FAQ.
This job has a configured gas limit of 1,000,000 for writing your result on-chain. If your transaction isn't returning any value after more than 60 seconds of waiting, click the above 'Oracle Address' for this job to see if any recent transaction(s) have failed due to an 'out of gas' error. If so, you'll need to either A) Return a smaller response, B) Split your request into multiple oracle transactions, or C) Contact us to request a higher gas allowance for your specific use case (may result in higher job pricing).
Still need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Simulating the above request logic
Let's walk through each step of the above sample request, to better understand how it all works together:
1. Send the HTTP request:
The following curl
command simulates the same HTTP request that our Chainlink node makes shortly after you trigger the request()
function within your consumer contract:
curl "https://httpbin.org/post" \
--request 'POST' \
--header 'content-type: application/json' \
--header 'set-cookie: sid=14A52' \
req._add('body', '{"data":[[false,false,true],[false,true,true],[true,false,true]]}');
2. Analyze the response:
The following is a sample response body returned to our Chainlink node by the above HTTP request (abbreviated for clarity):
{
"json":{
"data":[
[
false,
false,
true
],
[
false,
true,
true
],
[
true,
false,
true
]
]
}
}
3. Apply the JSON path:
After receiving the above sample response, our Chainlink node will attempt to filter the result by the provided path
parameter value (json,data,0,2;json,data,1,0;json,data,2,1
), which contains 3 separate (;
-delimited) JSON paths. After applying the provided path parameter, we get the following array, which is ultimately written to your smart contract as a bool[]
object by our Chainlink oracle:
[true,false,false]
Something else
Have a custom requirement?
We've got you covered:
- Fill out our Request Survey with the relevant details about your request.
- We'll assess your request and provide you with a custom job ID that works for you in 24 hours or less!
Join our Discord to get the fastest service for your request!
What do you want to retrieve?
Data from the internet (HTTP request)
Retrieve a string
(bytes
) from the internet
This on-demand job initiates an HTTP GET
, POST
, PUT
, or DELETE
request to the internet, optionally parses a JSON-based response body for a value at the given path, and returns the resulting dynamic bytes array (bytes) - which can also be represented as a string - to your consumer contract.
This job writes a single bytes object to your contract, which can readily be converted into a string value.
Request metadata
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 8ced832954544a3c98543c94a51d6a8d | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
method | string | 'POST' | The HTTP method to use in initiating your request for data (GET , POST , PUT , or DELETE ). |
url | string | 'https://myRequestURL.com/path?var1=abc&var2=xyz' | The URL to which to send your HTTP request for data. |
headers | string | '["my-header-1", "header 1 value", "my-header-2", "header 2 value"]' | An array of headers to send with the HTTP request, represented as an even-numbered array of strings. If no headers are desired, you must pass an empty string (''). |
body | string | 'My request body' | A body to send with the HTTP request (POST , PUT requests only). If no body is desired or applicable, you must pass an empty string (''). |
path | string | 'data,0,val' | The JSON Path at which to extract the result returned by the requested HTTP endpoint (JSON results only). To return the full result without parsing, you must pass an empty string (''). If the provided path cannot be found in the response, the request will not be fulfilled. |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need to send sensitive information?
Data entered into a smart contract is visible to the general public.
If you need to send sensitive information along with your HTTP request (ie, an API key), you can instead store this information off-chain on our secure infrastructure. Please fill out our Request Survey to get started, and specify within the notes that you'd like us to store your API key for you - once we receive your information, we'll provide you with a custom job ID that will send your sensitive data safely along with your request.
Troubleshooting
Having trouble with your request? Check our Chainlink Direct Requests FAQ.
This job has a configured gas limit of 1,000,000 for writing your result on-chain. If your transaction isn't returning any value after more than 60 seconds of waiting, click the above 'Oracle Address' for this job to see if any recent transaction(s) have failed due to an 'out of gas' error. If so, you'll need to either A) Return a smaller response, B) Split your request into multiple oracle transactions, or C) Contact us to request a higher gas allowance for your specific use case (may result in higher job pricing).
Still need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Simulating the above request logic
Let's walk through each step of the above sample request, to better understand how it all works together:
1. Send the HTTP request:
The following curl
command simulates the same HTTP request that our Chainlink node makes shortly after you trigger the request()
function within your consumer contract:
curl 'https://httpbin.org/post' \
--request 'POST' \
--header 'content-type: application/json' \
--header 'set-cookie: sid=14A52' \
--data '{"data":[{"id":1,"name":"Bitcoin","price":20194.52},{"id":2,"name":"Ethereum","price":1850.46},{"id":3,"name":"Chainlink","price":18.36}]}'
2. Analyze the response:
The following is a sample response body returned to our Chainlink node by the above HTTP request (abbreviated for clarity):
{
"json":{
"data":[
{
"id":1,
"name":"Bitcoin",
"price":20194.52
},
{
"id":2,
"name":"Ethereum",
"price":1850.46
},
{
"id":3,
"name":"Chainlink",
"price":18.36
}
]
}
}
3. Apply the JSON path:
After receiving the above sample response, our Chainlink node will attempt to filter the result by the provided path
parameter value (json,data,0,name
). After applying the provided path, we get the following result, which is ultimately written to your smart contract as a bytes
object (which can also be represented as a string
object) by our Chainlink oracle:
"Bitcoin"
Note that the double-quotes will not be present when retrieving the above response as a string
object within your smart contract.
Something else
Have a custom requirement?
We've got you covered:
- Fill out our Request Survey with the relevant details about your request.
- We'll assess your request and provide you with a custom job ID that works for you in 24 hours or less!
Join our Discord to get the fastest service for your request!
What do you want to retrieve?
Data from the internet (HTTP request)
Retrieve a string[]
(bytes[]
) from the internet
This on-demand job initiates an HTTP GET
, POST
, PUT
, or DELETE
request to the internet, optionally parses a JSON-based response body for a value at the given path, and returns the resulting array of dynamic bytes arrays (bytes[]) - which can also be represented as a string[] - to your consumer contract.
This job writes a single bytes[] object to your contract, which can readily be converted into a string[] value.
Request metadata
Oracle Address | Job ID | Fee Per Request |
---|---|---|
0xa57f0cEd49bB1ed7327f950B12a8419cFD01855f | 07f761e26a284cb8b7ed67188dece6d4 | 0 LINK |
Request parameters
This job requires the following parameters to be set within your contract's request()
function:
Parameter | Type | Value example | Description |
---|---|---|---|
method | string | 'POST' | The HTTP method to use in initiating your request for data (GET , POST , PUT , or DELETE ). |
url | string | 'https://myRequestURL.com/path?var1=abc&var2=xyz' | The URL to which to send your HTTP request for data. |
headers | string | '["my-header-1", "header 1 value", "my-header-2", "header 2 value"]' | An array of headers to send with the HTTP request, represented as an even-numbered array of strings. If no headers are desired, you must pass an empty string (''). |
body | string | 'My request body' | A body to send with the HTTP request (POST , PUT requests only). If no body is desired or applicable, you must pass an empty string (''). |
path | string | 'data,0,val;data,1,val;data,2,val' | A semicolon-delimited list of JSON Paths at which to extract data from the result returned by the requested HTTP endpoint (JSON results only). If a single path is desired, enter the path without any semicolons. If multiple paths are specified, an array (bytes[] ) will be returned containing result of each requested path, with order preserved. If any of the provided path(s) cannot be found in the response, the request will not be fulfilled. To return the full result without any parsing (must be an array), you must pass an empty string (''). |
contact | string | 'derek_linkwellnodes.io' | Enter your Discord handle, email address, or other contact info here. This is important for allowing prompt communication from us regarding outages or other technical issues that we may notice with your request. If you prefer to stay anonymous, you must pass an empty string (''). |
Try it for yourself
Add the following sample code to your consumer contract.
For easy editing, you can also open our sample contract directly in Remix.
1. Add the constructor:
The constructor specifies important information about the request destination and payment for your request. Important: This information varies by chain, oracle, and job:
loading...
2. Add your request function (example):
The request()
function defines the request parameters and sends a request to the Chainlink oracle. For detailed information on each required parameter, reference the above 'Request parameters' section:
loading...
3. Retrieve the response (example):
loading...
Need to send sensitive information?
Data entered into a smart contract is visible to the general public.
If you need to send sensitive information along with your HTTP request (ie, an API key), you can instead store this information off-chain on our secure infrastructure. Please fill out our Request Survey to get started, and specify within the notes that you'd like us to store your API key for you - once we receive your information, we'll provide you with a custom job ID that will send your sensitive data safely along with your request.
Troubleshooting
Having trouble with your request? Check our Chainlink Direct Requests FAQ.
This job has a configured gas limit of 1,000,000 for writing your result on-chain. If your transaction isn't returning any value after more than 60 seconds of waiting, click the above 'Oracle Address' for this job to see if any recent transaction(s) have failed due to an 'out of gas' error. If so, you'll need to either A) Return a smaller response, B) Split your request into multiple oracle transactions, or C) Contact us to request a higher gas allowance for your specific use case (may result in higher job pricing).
Still need more help?
Please reach out to us in Discord if you require additional assistance with this request.
Simulating the above request logic
Let's walk through each step of the above sample request, to better understand how it all works together:
1. Send the HTTP request:
The following curl
command simulates the same HTTP request that our Chainlink node makes shortly after you trigger the request()
function within your consumer contract:
curl "https://httpbin.org/post" \
--request 'POST' \
--header 'content-type: application/json' \
--header 'set-cookie: sid=14A52' \
--data '{"data":[["Coinbase","Binance","Kraken"],["Huobi","Crypto.com","KuCoin"],["Yobit","Gemini","OKX"]]}'
2. Analyze the response:
The following is a sample response body returned to our Chainlink node by the above HTTP request (abbreviated for clarity):
{
"json":{
"data":[
[
"Coinbase",
"Binance",
"Kraken"
],
[
"Huobi",
"Crypto.com",
"KuCoin"
],
[
"Yobit",
"Gemini",
"OKX"
]
]
}
}
3. Apply the JSON path:
After receiving the above sample response, our Chainlink node will attempt to filter the result by the provided path
parameter value (json,data,0,2;json,data,1,0;json,data,2,1
), which contains 3 separate (;
-delimited) JSON paths. After applying the provided path parameter, we get the following array, which is ultimately written to your smart contract as a bytes[]
object (which can also be represented as a string[]
) object by our Chainlink oracle:
["Kraken","Huobi","Gemini"]
Note that the double-quotes will not be present when retrieving any of the above array elements as a string
within your smart contract.
Something else
Have a custom requirement?
We've got you covered:
- Fill out our Request Survey with the relevant details about your request.
- We'll assess your request and provide you with a custom job ID that works for you in 24 hours or less!
Join our Discord to get the fastest service for your request!
Need a custom data type delivered?
We've got you covered:
- Fill out our Request Survey with the relevant details about your request.
- We'll assess your request and provide you with a custom job ID that works for you in 24 hours or less!
Join our Discord to get the fastest service for your request!