Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 906 Bytes

File metadata and controls

51 lines (42 loc) · 906 Bytes

Wplace API

Unofficial library to interact with the Wplace.live backend API

Docs

https://jsr.io/@j0code/wplace-api/doc

Install

JSR (node.js)

npx jsr add @j0code/wplace-api

JSR (Deno)

deno add jsr:@j0code/wplace-api

JSR (Bun)

bunx jsr add @j0code/wplace-api

NPM

npm i wplace-api

Usage Example

import WplaceAPI from "@j0code/wplace-api"

const api = new WplaceAPI()

const pixel = await api.getPixel(1, 2, 3, 4) // get pixel 3;4 from tile 1;2
console.log(pixel)
/* prints:
{
	paintedBy: {
		id: ...,
		name: '...',
		allianceId: 0,
		allianceName: '',
		equippedFlag: 0
	},
	region: { id: 0, cityId: 6919, name: 'Anchorage', number: 1, countryId: 235 }
}
*/

const tile = await api.getTile(1, 2) // get tile 1;2 as a pngjs PNG instance

await api.downloadTile(1, 2, "tile.png") // downloads tile 1;2 and saves it in ./tile.png