Skip to main content

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-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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geoguessr_async-2.1.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geoguessr_async-2.1.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file geoguessr_async-2.1.0.tar.gz.

File metadata

  • Download URL: geoguessr_async-2.1.0.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for geoguessr_async-2.1.0.tar.gz
Algorithm Hash digest
SHA256 ad715571a0312b241b3e9a8f2b1cefe66d1dd902ba292394b1412d0840beacc9
MD5 18e39e22cc0a56022e141b62a93ce51d
BLAKE2b-256 1e43a7f1fdb4bb58ed196635fe5bab97b4b6ad9f6d17366a3794eb6e937e8ef3

See more details on using hashes here.

File details

Details for the file geoguessr_async-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for geoguessr_async-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53c91f1d563fc2027fff74753d7d7087686fd37bfebb4b448a7cbaee0b0be42c
MD5 f235333a6800798abdf9700fda011465
BLAKE2b-256 a04a3baf136769dce2d3b73b7de8545f8f27b74c94d9794370a40dadff6cee29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page