232 lines · 6.3 KB · Markdown
RawDownload

GSI API Endpoints

All endpoints are accessed via:

POST https://www.gaiaonline.com/chat/gsi/json.php

with body parameter m = [method_id, [args...]] and X = unix_timestamp.

For batch requests: m = [[method_id_1, [args_1]], [method_id_2, [args_2]]]


Known Methods

Method 102 — Get User

Retrieves user profile data by ID, username, email, or session ID.

Field Value
Method ID 102
Auth Public
Source Grabbit, mail-checker userscript

Request:

m = [102, ["someusername"]]

or by numeric ID:

m = [102, [3]]

Response fields (data_object):

username        string    Display name
user_id         int       Numeric user ID
user_pms        int       Count of unread private messages
avatar_url      string    URL to rendered avatar image
join_date       int       Unix timestamp of registration

Notes:

  • This is the same method used to look up PM counts in the mail-checker script
  • Lookup can be by ID (int), username (string), email (string), or session ID (string, method 107)
  • Method 107 is a variant that accepts session ID as identifier

Method 107 — Get User by Session ID

Variant of method 102 that identifies the user by their active session ID rather than a persistent identifier.

Field Value
Method ID 107
Auth Requires valid session
Source Grabbit (GetUser::bySessionId)

Method 712 — Get Item

Retrieves item data by item ID.

Field Value
Method ID 712
Auth Public
Source Grabbit (GetItem)

Request:

m = [712, [1404]]

Response fields (data_object[0][2][0]):

item_id         int       Numeric item ID
item_name       string    Display name
item_desc       string    Item description
rarity          string    Rarity tier
category        string    Item category (clothing, hair, etc.)

Notes:

  • Returns a 404-equivalent if data[0][2][0]['item_id'] is not set
  • Grabbit throws ItemNotFoundException in this case

Method 6500 — Get Server Time

Returns the current Gaia server Unix timestamp.

Field Value
Method ID 6500
Auth Public
Source is-it-glowing userscript

Request:

m = [6500, [1]]

Response fields (data_object):

gaia_curr_time  int       Current server Unix timestamp (10-digit)

Notes:

  • Used by the glow-checker to compare against open_time values
  • Always called in batch with 6510/6511 to avoid clock skew issues

Method 6510 — Get User Environment (Aquarium)

Retrieves aquarium data for a given environment ID.

Field Value
Method ID 6510
Auth Partially public (may need session cookie)
Source Grabbit (GetUserEnvironment), is-it-glowing userscript

Request:

m = [6510, [9116373, false, true]]

Arguments:

  1. environment_id (int/string) — The aquarium's ID
  2. location (bool) — true = editor view, false = profile view
  3. hide (bool) — false shows more game info; true hides some fields

Response fields (data_object[environment_id]):

name            string    Aquarium name
user_id         int       Owner's user ID
game_info       object    Booty Grab game state
  [1]
    open_time   int       Unix timestamp when glow event opens (0 if not glowing)
    instance_id string    Unique ID for this glow instance (changes each glow)
    player_count int      Current players in Booty Grab

Notes:

  • Response is keyed by environment ID, not a flat array
  • game_info[1] is the Booty Grab state; game_info[0] may be another game type
  • If open_time is set and instance_id is new, the tank is live for Booty Grab
  • Grabbit uses a fake session cookie (gaia55_sid=aaa...) as a workaround

Method 6511 — Get Aquarium Inhabitants

Returns the fish/creatures in a specific aquarium.

Field Value
Method ID 6511
Auth Public
Source Grabbit (GetInhabitants), is-it-glowing userscript

Request:

m = [6511, [9116373, false]]

Arguments:

  1. environment_id (int/string)
  2. item_specifics (bool) — whether to include item metadata

Response fields (data_object[creature_key]):

item_id          int      Item ID of this creature type
in_env           int      1 = currently in tank, 0 = retired
game_specifics   object   Present if this fish is currently glowing
item_specifics   object   Item metadata (if requested)

Notes:

  • game_specifics being present on a creature means it's contributing to the active Booty Grab
  • Fish with game_specifics set while in_env == 1 are the live glow sources
  • When item_specifics = true, response also includes item_specifics dictionary keyed by item ID

Batch Request Example

The is-it-glowing userscript used this batch pattern to get all aquarium state in one round-trip:

// GET three methods at once: server time + aquarium state + inhabitants
var url = 'http://www.gaiaonline.com/chat/gsi/index.php?v=json' +
  '&m=[[6500,[1]],[6510,["' + tankId + '",0,1]],[6511,["' + tankId + '",0]]]' +
  '&X=' + Math.floor(Date.now() / 1000);

Response structure:

[
  [6500, true, { "gaia_curr_time": 1694001234 }],
  [6510, true, { "12345": { "name": "...", "game_info": { "1": { "open_time": 1694001100 } } } }],
  [6511, true, { "0": { "item_id": 9999, "in_env": 1, "game_specifics": {...} } }]
]

Unknown / Speculated Methods

Based on naming conventions and community reports, other methods likely exist for:

  • Posts / forum threads
  • Marketplace listings
  • Friend lists
  • Notification counts
  • Guild membership

These have not been confirmed from open-source library source code.


Sources

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t