API QUICK REFERENCE

Search common Screeps APIs

Find common APIs by object, method, or keyword, or start from Creep, Room, Spawn, Controller, Market, Link, Tower, Terminal, Lab, PathFinder, and Store hubs. This page remains a practical navigation and recall layer rather than a replacement for the official API Reference. For state-changing actions, record return codes and verify later-tick state.

API COVERAGE

Current site coverage snapshot

This counts the site's own quick-reference entries, object/practice hubs, and P0 evidence paths. It is not a claim that every official Screeps API is documented here.

29quick-reference entries
11object / practice hubs
10P0 runtime evidence paths
Game6 entries
Creep8 entries
Room2 entries
Structures10 entries
Systems3 entries

OBJECT HUBS

Start from a core game object

Use these hubs when you already know the object you are working with. Each hub connects the shared API reference to existing guides, return codes, tools, and accepted runtime verification.

11
Creep

Creep API Hub

A focused hub for Creep movement, harvesting, hauling, Controller upgrading, return codes, guides, and tools.

6 API entries · 7 return-code paths
Room

Room API Hub

A focused hub for room visibility, Construction Sites, Event Log, and room-level diagnostics.

3 API entries · 4 return-code paths
StructureSpawn

StructureSpawn API Hub

A focused hub for spawnCreep(), renewCreep(), recycleCreep(), Spawn return codes, and capacity planning.

3 API entries · 6 return-code paths
StructureController

Controller API Hub

A focused hub for Controller upgrading, downgrade risk, Safe Mode, reservation, claiming, tools, and return codes.

1 API entries · 5 return-code paths
Game.market

Market API Hub

A focused hub for Game.market deals, order creation, Terminal transport budgeting, and Market tools.

3 API entries · 3 return-code paths
StructureLink

StructureLink API Hub

A focused hub for Link Energy transfer, cooldown, capacity, room logistics, and Controller supply debugging.

1 API entries · 5 return-code paths
StructureTower

StructureTower API Hub

A focused hub for Tower attack, heal, repair, range falloff, Energy budgeting, and defense planning.

1 API entries · 4 return-code paths
StructureTerminal

StructureTerminal API Hub

A focused hub for Terminal sends, transaction Energy, stock, cooldown, and Market cost planning.

1 API entries · 4 return-code paths
StructureLab

StructureLab API Hub

A focused hub for Lab reactions, Boosts, mineral and Energy prerequisites, cooldown, and production planning.

2 API entries · 7 return-code paths
PathFinder

PathFinder API Hub

A focused hub for tile-level PathFinder, room-level routes, ERR_NO_PATH, CostMatrix, and movement debugging.

2 API entries · 2 return-code paths
Store

Store Practice Hub

A practical hub for Store used, free, and total capacity semantics across Creep hauling, Storage, Containers, and room economy.

0 API entries · 2 return-code paths

Showing 29 / 29 entries

Game

Game.time

Read the current game tick number for scheduling, logs, and cross-tick state decisions.

ticktimegame loop
Open site guide →
Game

Game.rooms[roomName]

Read currently visible Rooms. A Room without vision is not present and may evaluate to undefined.

Roomvisionundefined
Open site guide →
Game

Game.getObjectById(id)

Restore a currently accessible game object from its ID. Returns null when the object cannot be resolved.

IDMemorycached targetnull
Open site guide →
Game

Game.notify(message, groupInterval)

Queue an account notification for Controller risk, colony failures, and other events that matter outside the Console.

notificationalertgroupInterval
Open site guide →
Game

Game.cpu.getUsed()

Read CPU used so far in the current tick and compare before/after samples around a code section.

CPUbucketperformance
Open site guide →
Game

Game.map.findRoute(from, to, opts)

Plan a room-level route between rooms and inspect exit directions plus the next-room sequence.

cross-roomrouterouteCallback
Open site guide →
Creep

creep.moveTo(target, opts)

Schedule Creep movement. OK means the movement request was accepted, not that the position already changed.

movementERR_NO_PATHfatiguepath
Open site guide →
Creep

creep.harvest(target)

Harvest from an allowed Source, Mineral, or other resource target when the Creep has the required body parts.

SourceEnergyWORKharvest
Open site guide →
Creep

creep.transfer(target, resourceType, amount?)

Transfer a resource from the Creep Store to a target that can receive it.

haulingEnergyStoreSpawn
Open site guide →
Creep

creep.withdraw(target, resourceType, amount?)

Withdraw a resource from a Structure, Tombstone, or Ruin Store.

ContainerStorageStorewithdraw
Open site guide →
Creep

creep.pickup(resource)

Pick up a dropped Resource object. Stored resources in Containers and similar targets use withdraw instead.

dropped resourceEnergyResource
Open site guide →
Creep

creep.upgradeController(controller)

Spend carried Energy through WORK parts to add progress to an owned Controller.

ControllerupgradeWORKUpgrader
Open site guide →
Creep

creep.build(target)

消耗 Creep 携带的 Energy 推进 Construction Site 建造进度,需要有效 WORK 部件并满足动作距离。

BuilderConstruction SiteWORKEnergy
Open site guide →
Creep

creep.repair(target)

消耗 Creep 携带的 Energy 修复可维修结构,需要有效 WORK 部件并满足动作距离。

BuilderrepairWORKEnergy
Open site guide →
Room

room.createConstructionSite(x, y, structureType)

Submit a Construction Site request at a position and use the return code as the authoritative immediate result.

Construction SitebuildRoad
Open site guide →
Room

room.getEventLog(raw?)

Read the previous tick's room events for follow-up evidence around attacks, repairs, construction, and other actions.

event logeventprevious tick
Open site guide →
Structures

spawn.spawnCreep(body, name, opts?)

Submit a Creep spawn request. Validate name, body, Energy, dryRun, and the final return code.

SpawnCreepbodydryRun
Open site guide →
Structures

spawn.renewCreep(creep)

Use an owned Spawn to extend an eligible normal Creep's lifetime while accounting for Spawn occupancy and Boost limits.

SpawnTTLticksToLiverenew
Open site guide →
Structures

spawn.recycleCreep(creep)

Recycle a Creep you no longer need. The target must be near your Spawn and should be treated as an explicit one-way task.

SpawnCreeprecycle
Open site guide →
Structures

tower.attack() / heal() / repair()

Use a Tower's attack, heal, or repair action. These actions share the tick's action opportunity and scale with range.

Towerattackhealrepair
Open site guide →
Structures

terminal.send(resourceType, amount, destination, description?)

Send resources across rooms while the sender pays transaction Energy. Check cooldown, stock, and destination first.

Terminalcross-roomEnergylogistics
Open site guide →
Structures

lab.runReaction(inputLab1, inputLab2)

Run a reaction in an output Lab using minerals from two input Labs to produce a compound.

LabreactionREACTIONS
Open site guide →
Structures

lab.boostCreep(creep, bodyPartsCount?)

Spend a Lab's compound and Energy to boost matching Creep body parts.

LabBoostbodyPartsCount
Open site guide →
Structures

factory.produce(resourceType)

Produce a commodity from COMMODITIES recipes after checking components, capacity, level, and cooldown.

FactoryCOMMODITIEScommodity
Open site guide →
Structures

observer.observeRoom(roomName)

Request vision for a remote room and read that Room from Game.rooms on a later tick.

Observervisioncross-room
Open site guide →
Systems

Game.market.deal(orderId, amount, roomName?)

Execute a real market deal after checking the order, Credits, resource stock, and Terminal transaction cost.

MarketdealorderCredits
Open site guide →
Systems

Game.market.createOrder(params)

Create your own market buy or sell order and account for the order creation fee.

MarketordercreateOrder
Open site guide →