After creating a private endpoint on the Dashboard, users will be able to add and manage API Keys to further enhance application security and control. Users can add and delete API keys, as well as whitelisting domains and IPv4 addresses if they so choose.
After creating an API Key, you'll need include it in your requests. There are two ways to do this:
Using an x-api-key header (Recommended):
curl<endpoint_here> \-X POST \-H "x-api-key: <api_key_value>" \-H "Content-Type: application/json" \
from web3 import Web3import requests#define a http session with an api keyhttp_session = requests.Session()http_session.update({'x-api-key': 'api_key_here'})#defined the web3 providerclient = Web3.HTTPProvider('endpoint here')
Appending the API Key as a query parameter in the URL:
curl"<endpoint_here>?apikey=<your-api-key>" \-X POST \-H "Content-Type: application/json" \
from web3 import Web3import requests# Define the Web3 provider with API key in the URLclient =Web3(Web3.HTTPProvider('endpoint_here?apikey=api_key_here'))
import { Web3, HttpProvider } from'web3';// Define Web3 client with API key in the URLconstclient=newWeb3(newHttpProvider('endpoint_here?apikey=your-api-key'));