Main interface introduction Interface introduction Example of query
OpenApi (GQL)
Transaction statistics for Token Pair Real-time transaction records Current values of governance items Personal data about revenue and trade
BurgerSwap OpenAPI Instructions (First Edition)

Main interface introduction

⦁ The red box are functions

⦁ The blue words are used as marks;

⦁ 1, 2, 3, 6, 7 are buttons;

⦁ 4, 5 are content display areas;

Number 1: Execute a query When the query is completed, you can click the number 1 button to perform the operation, and the query result will be displayed in the query result area (number 5).

Number 2: Prettify Button to format the query code, you can click it to format the code at any time. If the code has an error, it will prompt an error;

Number 3: History Button to open the query history, you can view the history of the previous query, and select an entry to perform the query operation again;

Number 4: Query code editing area You can write and edit queries according to your needs. Includes the function of editing code online;

Number 5: Query result area Click the Query button, and the query results will be displayed here one by one;

Number 6: Schema, Interface documentation Opens the help file, here you can view the content that can be queried, and query filter rules;

Number 7: Query variables By creating variables, the query code can use variables to filter the query results;

Interface introduction

The main 3 functions include quick search, query, and subscription.

Quick search:
Enter key fields in the search box to easily search for relevant query examples;

Display all available queries;

Not available at the moment;
The following is the content displayed on the query interface;

Example of query

Query all tokens on the BurgerSwap platform. You need to check tokenEntities.

Area 1:
Query entity filters, enter the corresponding conditions to filter the query results;
click the yellow field to view the introduction of the content that can be entered;

skip: skip a number
First: starting index
orderBy: sort by a certain field
orderDirection: sort in order or reverse order
where: restrictions
block: When you need a specific block, enter the corresponding block number
[TokenEntity]:Query specific content, such as: ID address; symbol; name; decimals;

Query all currencies and tokens on the BurgerSwap platform
Enter in the query code editing area:
{ tokenEntities { id symbol name decimals } }

The results are as shown

If you don't need to check the decimals, just delete the decimals field in the query code;
The following filters the information of query BURGER. Enter it in the query code editing area:

{ tokenEntities (where:{symbol:"BURGER"}){ id symbol name decimals } }

Create variable method to filter out BURGER information
Step 1:
Create variables: ”token”:”BURGER”

Step 2:
Enter in the query code editing area:
query Query($token: String) { tokenEntities(where: {symbol: $token}) { id symbol name decimals } }

Use the sort function to query the information of all trading pairs, sorted in descending order by the number of users
{ pairEntities(orderBy: playerCount, orderDirection: desc) { id token0 { symbol } token1 { symbol } totalSupply playerCount } }

After running the query result, all pools are sorted according to the number of users, with
BURGER-WBNB 1509 on top with the largest number of users;

Check the stock of WBNB-BUSD
Use pairAddressEntities to filter the address "0xa5e6519e1623547b7c6b1ec8f0f4f918bbace5dd";
sort by reserve in descending order;

{ pairAddressEntities(orderBy:reserve,orderDirection:desc, where: { pair:"0xa5e6519e1623547b7c6b1ec8f0f4f918bbace5dd"}) { id pair token0 { symbol } token1 { symbol } reserve block } }

Use where to filter the results:
Open PairAddressEntity_filter, all available restrictions are displayed;