Skip to main content

Fuel GraphQL API

With QuickNode, you get access to our global network which always routes your API requests to the nearest available location, ensuring low latency and fastest speeds.
Beta

Note:

The QuickNode Fuel documentation constantly evolves as the chain undergoes upgrades and changes. We highly recommend cross-referencing with the Fuel Documentation for the latest updates.

Overview

At QuickNode, we run Fuel GraphQL API endpoints. In aggregate, we serve hundreds of billions of requests every month. To make it easier for developers to integrate with QuickNode, we've created this documentation that shows how to send GraphQL queries using popular programming languages and tools.

Fuel is a modular blockchain platform designed to enhance scalability, security, and decentralization. It separates execution from consensus, enabling high-performance and low-cost transactions. With innovations like parallel transaction execution and an optimized UTXO model, Fuel aims to provide a more efficient blockchain experience for developers and users. QuickNode-supported Fuel APIs include:

  • Fuel GraphQL API

Fuel Network Support

NetworkHTTPS
SEPOLIA
MAINNET

Fuel GraphQL API Documentation

Fuel does not have predefined methods for interacting with the blockchain; instead, it leverages GraphQL for sending queries and mutations. This flexible approach allows users to customize their requests based on specific needs, offering a more powerful and tailored way to interact with the blockchain.

We’ve provided 17 sample queries showcasing some of the most common GraphQL requests with Fuel. These examples are designed to help you get started, and you can easily customize or expand them to fit your specific data needs.

Below is a generic template for sending GraphQL requests to the Fuel blockchain. You can modify the query and variables as needed to interact with different parts of the network:


curl --location 'https://<your-fuel-endpoint>/v1/graphql' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"query": "<Your GraphQL Query Here>",
"variables": {
"id": "0x45A....." // Add variables if needed
}
}'

For detailed GraphQL API documentation and usage guides, please refer to the official Fuel documentation.

Making Fuel GraphQL API Requests

In this documentation, you will see example requests made with various programming languages for each supported Fuel query. This section will explain how to execute each one of them on your machine.

cURL

Most *nix based systems have cURL support out of the box. cURL is a command line tool and library for transferring data with URLs. Check if you have it by running the following:

curl -h

Python

To run our Python code examples, you'll need to have Python installed as well as the requests package. You can install this package with the following command:

python -m pip install requests

JavaScript

To run our JavaScript code examples, you'll need to have Node v18 and up installed. You can follow this official document to install the latest, stable version of Node globally. Check if you have it by running the following:

node -v

Ruby

To run our Ruby code examples, you'll need to have Ruby installed. You can follow this official installation document for more information. Check if you have it by running the following:

ruby -v

TypeScript

To run our TypeScript code examples, you'll need to have Node.js installed, as TypeScript is built on top of JavaScript. Ensure you also have TypeScript installed globally by running:

npm install -g typescript

Apollo JS Client

To run Apollo Client code examples in JavaScript or TypeScript, you need Node.js (v18 or above). Additionally, you'll need to install Apollo Client via npm. Install it by running:

npm install @apollo/client graphql

API Credits

Usage in our pricing plans is measured in API Credits. To learn more about the API Credits for Fuel, please visit this page.

Endpoint Authentication Options

Token Authentication

By default, all endpoints created on QuickNode are protected by a token in the URL which looks something like this:

http://sample-endpoint-name.network.quiknode.pro/token-goes-here/

Approved Referrer List

For endpoints on the shared network, you are able to add a list of approved referrers. This requires any HTTP request to send a REFERRER header or any WebSocket request to send an ORIGIN header populated with one of the referrers you entered into our user panel.

Disabling Token Authentication

You can also disable the token authentication completely in your security settings for a given endpoint. This will allow anyone to make requests to the endpoint without the token.

JWT (JSON Web Tokens)

For additional security, you can also enable JWT for each of your deployed endpoints. JWT allows for stateless authentication between you and your endpoint. Learn how to use JWT with QuickNode in this step-by-step guide.

Multiple Authentication Tokens

Create multiple authentication tokens for each of your deployed endpoints. This allows you to revoke any tokens that may be comprised, without needing to restart your non-compromised endpoint.

To roll an individual authentication token, create an additional token and then delete the previous token. Learn more about multiple authentication tokens in this QuickNode guide.

We ❤️ Feedback!

If you have any feedback or questions about this documentation, let us know. We'd love to hear from you!

Share this doc