screeps-api
    Preparing search index...

    Screeps servers can be loosely grouped into two categories:

    There are several key differences between these categories.

    As of December 29, 2017, clients can authenticate to the API on official servers using auth tokens obtained from the account settings page. On February 1, 2018, email/password authentication was disabled on official servers (announcement).

    For unofficial servers, however, email/password credentials are the only supported method for API authentication.

    While any Screeps server could technically implement this feature, the official servers (specifically MMO and PTR) are the only known servers that split the game map into multiple interconnected shards.

    The API for sharded servers is slightly different than the API for shardless servers.

    Endpoints that expect a room parameter (ex: ScreepsHttpClient.gameMapStats) typically expect a shard parameter as well, and they will reject requests that omit it. ScreepsClientConfig.defaultShard can be used to set a default value for all endpoints that require this parameter.

    Shardless servers will silently ignore shard parameters for those same endpoints.

    Endpoints that can return room results for multiple shards in a single response typically format the response in one of two ways:

    1. Responses that contain objects indexed by room name are first indexed by shard name (ex: ScreepsHttpClient.gameMapStats). ScreepsHttpClient normalizes results from shardless servers by grouping all room results under a privSrv key.

    2. Responses that contain room name strings will prefix the room names with the shard name (ex: W0N0 becomes shard0/W0N0). This also applies to events on the WebSocket API (ex: RoomEvent).