Skip to main content
POST
https://0xcord.com
/
api
/
vrfv2
/
requestRandomNumber
Request Random Numbers
curl --request POST \
  --url https://0xcord.com/api/vrfv2/requestRandomNumber \
  --header 'Authorization: <api-key>'
{
  "data": {
    "success": true,
    "requestId": "<string>",
    "transactionHash": "<string>",
    "url": "<string>",
    "randomNumber": [
      {}
    ]
  }
}

Params

network
string
default:"fantom_testnet"
required
The blockchain network to retrieve random numbers from
numWords
integer
default:"1"
required
The quantity of random numbers to retrieve from Chainlink
confirmations
integer
default:"1"
The number of block confirmations required before returning data
uniqueParam
string
The Keccak256 hash of a unique parameter

Response

data
object
success
boolean
Indicates whether the request was successful
requestId
string
The unique request ID assigned by Chainlink
transactionHash
string
The transaction hash of the request on the blockchain
url
string
The URL to the transaction details on the blockchain explorer
randomNumber
array
An array containing the retrieved random numbers

Chainlink VRF V2 Tutorial

Learn how to integrate Chainlink VRF V2 with 0xCord