Skip to content

Commit a302f12

Browse files
committed
Add some example code to README
1 parent b2e4dbf commit a302f12

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ Go to the Hypixel Minecraft Java server and use `/api` command.
1818
### I found a bug/I want to add a missing feature!
1919
Just make a new issue [here](https://github.com/PyBotDevs/skyblockpy/issues/new) and describe the bug/feature.
2020

21+
### Example Implementation of SkyblockPy
22+
Here's an example snippet of retrieving the third page of the latest Skyblock auctions.
23+
24+
```py
25+
import skyblockpy
26+
27+
skyblock = skyblockpy.Skyblock("api_key") # Initialize the Skyblock class with a prospective Hypixel API key.
28+
29+
def latest_auctions_raw() -> dict: # Make a function for returning API output, and highlight return output type as dict.
30+
output = skyblock.get_auctions(page=3) # Gets the API response.
31+
return output
32+
33+
latest_auctions_raw() # Run the actual function now.
34+
```
35+
2136
<hr>
2237

2338
### Hypixel API Documentation is given here: https://api.hypixel.net/

0 commit comments

Comments
 (0)