Geometry Dash API, How to use it

Dec 13, 2024

This article explores how to use various Geometry Dash APIs based on the provided search results. Note that some results are incomplete due to access restrictions.

Geometry Dash API, How to use it

Geometry Dash API: How to Use It?

This article explores how to use various Geometry Dash APIs based on the provided search results. Note that some results are incomplete due to access restrictions.

Using the GeometryDashAPI (C#)

This section details the usage of the GeometryDashAPI library, available via NuGet. The provided documentation is somewhat limited.

Installation:

  1. Install GeometryDashAPI from NuGet.
  2. That's it! You can now use the library.

Example Usage (from GitHub):

The GitHub repository provides examples for manipulating levels and game data. Here's a snippet demonstrating level editing:

var local = await LocalLevels.LoadFileAsync();
var level = local.GetLevel("MyLevel", revision: 0).LoadLevel();

level.AddColor(new Color(11)
{
    Rgb = RgbColor.FromHex("#ffa500") // orange
});
for (var x = 0; x < 1024; x += 4)
{
    level.AddBlock(new ColorBlock(1887)
    {
        PositionX = x,
        PositionY = (float)Math.Sin(x / 100f) * 120,
        ColorBase = 11
    });
}

local.GetLevel("MyLevel", revision: 0).SaveLevel(level);
await local.SaveAsync();
GeometryDashAPI Wave Example

More information can be found in the GeometryDashAPI Wiki. The wiki also covers accessing stored game data (.dat/.plist files).

Using gd.py (Python)

This section covers the gd.py API, a Python wrapper for Geometry Dash. It offers a modern, asynchronous interface.

Features:

  • Modern Pythonic API using async and await syntax.
  • Implements the entire Geometry Dash API.
  • Easy to use with an object-oriented design.

Example Usage (from ReadTheDocs):

Loading a local Geometry Dash database is straightforward:

import gd
database = gd.api.save.load()

The documentation also shows asynchronous loading:

database = await gd.api.save.load_async()
GeometryDashAPI Banner

The gd.py documentation is extensive and covers various aspects of the Geometry Dash API, including client interaction, entity manipulation, level editing, and more. Refer to the gd.py documentation for comprehensive details.

Using geometry-dash-api (JavaScript)

This section describes a JavaScript NPM module for interacting with the Geometry Dash API. The provided documentation is incomplete.

Login:

Before using any API methods, you must log in:

(async () => {
  await client.login();

  const user = await api.users.getById(71);

  console.log(user); // => Object
})();

or

client.login().then(async (_user) => {
  const user = await api.users.getById(71);

  console.log(user); // => Object
  console.log(_user); // => Object { accountID: Number, userID: Number }
});

The documentation also includes examples for working with accounts, users, friends, and levels. However, due to the incomplete nature of the provided HTML content, further details are unavailable. Refer to the geometry-dash-api GitHub repository for more information.

Reddit Discussion on Geometry Dash API

A Reddit thread discusses the existence of a Geometry Dash API. The response indicates a desire for an API to retrieve player statistics. However, no concrete information about an official API is provided in this excerpt.

Note: Several image URLs in the provided HTML content were inaccessible, resulting in placeholder images. The functionality of the APIs may vary depending on the specific implementation and version. Always refer to the official documentation for the most up-to-date information.

Recent Posts