🔐Authentication
This page describes authentication methods used to securely access Web3 Graph API
The Web3 Graph API employs static API key protection to regulate access and enhance the security of its data endpoints. This means that users need to authenticate their requests by providing a valid API key. There are two methods available for transmitting this key when making requests to the API:
Query Parameter: You can append the API key directly to your request URL as a query parameter. This involves adding
?api_key=YOUR_API_KEY
to the end of the URL you're requesting. This method is straightforward and makes it easy to see and modify API keys in URL requests.HTTP Header: Alternatively, you can include the API key in your HTTP request headers. This involves adding an
X-API-KEY
header to your request and setting its value to your API key. This method is typically more secure, especially when making requests over HTTPS, as it keeps the API key out of the URL and thus out of server logs.
Employing API key protection is essential for ensuring that only authorized users can access and manipulate data through the Web3 Graph API. This layer of security helps prevent unauthorized access and potential misuse of the API. Users should maintain the confidentiality of their API keys, storing them securely and sharing them only within trusted applications. Regularly rotating API keys is also recommended as a best practice to further strengthen security measures and mitigate risk associated with key exposure.
Getting API key
Kindly contact us at: https://t.me/web3_social_graph with the request to get trial API key to try out Web3 Graph API or full API key with more generous/unlimited rate limits
Example
import requests
url="https://api.web3graph.xyz/api/v1/metadata/vitalikbuterin/tweets"
url_2=f"https://api.web3graph.xyz/api/v1/metadata/vitalikbuterin/tweets?api_key={api_key}"
headers={
'accept': 'application/json',
'x-api-key': api_key,
'Content-Type': 'application/json',
}
# both methods work
response = requests.get(url=url, headers=headers)
response2 = requests.get(url=url_2)
Last updated