An asynchronous API integrator for Geoguessr
Project description
This is a Geoguessr API client written in Python. It allows you to interact with the Geoguessr API, such as getting information about users, challenges, maps, and scores.
To install the package, run the following command:
pip install geoguessr-api
Once the package is installed, you can create a client object by passing your NCFA cookie to the constructor:
from geoguessr_async import Geoguessr
client = Geoguessr("your_ncfa_cookie")
To get your NCFA cookie, login to geoguessr, open your dev tools (Ctrl+Shift+I
), go to Storage/Cookies and copy the value of _ncfa
.
You can then use the client object to get information about users, challenges, maps, and scores. For example, to get information about an user with his ID, you can use the following code:
user = client.get_user_infos(userId)
The Profile
object will contain information such as your username, country, and number of games played.
To get information about a challenge, you can use the following code:
challenge = client.get_challenge_infos("https://geoguessr.com/challenge/xxxx")
The Challenge
object will contain information such as the challenge name, description, and time limit.
To get information about a map, you can use the following code:
map = client.get_map_infos("https://geoguessr.com/maps/xxxx")
The Map
object will contain information such as the map name, size, and location.
To get information about a score, you can use the following code:
score = client.get_challenge_score("https://geoguessr.com/challenge/xxxx")
The Score
object will contain information such as the players' name, score, and time.
When getting the score of a challenge, it automatically plays it, pinging (0, 0) each round.
Example: Get results of a challenge as a list of dictionnaries
score = client.get_challenge_score("https://geoguessr.com/challenge/xxxx")
scores = []
for s in score:
d_player = {
"userId": s.userId,
"userName":s.playerName,
"total": s.totalScore,
"roundPoints": s.gamePlayerGuessesRoundScoreInPoints,
"roundTimes": s.gamePlayerGuessesTime
}
scores.append(d_player)
print(scores)
I hope you find this package useful! Please let me know if you have any questions or feedback.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file api_geoguessr-1.0.0.tar.gz
.
File metadata
- Download URL: api_geoguessr-1.0.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a29751c2bdb0f089886373a2cf9b6ec73bd4c57a15229fe258fd30ca77b923e |
|
MD5 | 13fe0579f1b8811bdbb5be06cdb8a1b1 |
|
BLAKE2b-256 | a4b462cc2b1bbe693e097d052271eb61304eb737da7aeefce505d6a0740325ae |
File details
Details for the file api_geoguessr-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: api_geoguessr-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d87f4ab4ce4105c580b18fe205deb1eebcad0f666f22049f4e38b66b4d1347b7 |
|
MD5 | 5e7ec03d6c2b8cbbae0229b80cca877b |
|
BLAKE2b-256 | c28a69169e79f8262c806366753874274ea9957babf39a717a82d36d7d6b1372 |