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-async
Once the package is installed, you can create a client object by passing your NCFA cookie to the constructor:
import asyncio
from geoguessr_async import Geoguessr
async with Geoguessr("your_ncfa_cookie") as client:
await client.do_stuff()
To get your NCFA cookie, login to geoguessr, open your dev tools (Ctrl+Shift+I), go to Application/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 = await 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 = await 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 = await 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 = await 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 = await 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.
Metadata
Release files for geoguessr-async 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geoguessr_async-2.1.1.tar.gz | 33.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geoguessr_async-2.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.8 kB
Release files / geoguessr_async-2.1.1.tar.gz
| Download URL | geoguessr_async-2.1.1.tar.gz |
|---|---|
| Size | 33.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad8eba2d9298f03a2e0b75325335bbb14b02a83914b561b889451bcb6727e145
|
|
BLAKE2b-256 checksum How to use checksums |
305fe9b5b70b06dc5c10fe88372ba014337e8f3035acf7942cc57259cae87333
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / geoguessr_async-2.1.1-py3-none-any.whl
| Download URL | geoguessr_async-2.1.1-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a185fc91c975d12702f8f8f466b54e9007592ee8a0aed25b1416aba3cf18797d
|
|
BLAKE2b-256 checksum How to use checksums |
d79c89bc78a20793acf1bfe418c8e0d03bcd313fc23526832424d42431c2da03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|