Skip to content

azurlane-api/AzurLane

Repository files navigation

AzurLane

Api wrapper for my azur lane api

Example

const { AzurLane, Category } = require("azurlane");
const azurlane = new AzurLane();

async function main() {
    // Get specific ship by name, in this case "Akagi"
    const ship = await azurlane.getShipByName("Akagi");
    console.log(`${ship.names.en}'s rarity is ${ship.rarity}`); // IJN Akagi's rarity is Super Rare

    // Get an array of ships with rarity "Super Rare"
    const ships = await azurlane.getShips(Category.RARITY, "Super Rare");
    for (let i = 0; i < ships.length; i++) {
        console.log(`[${ships[i].id}] = ${ships[i].name}`); // [036] = San Diego
    }
}

// Also catches any api errors that might occur like 400, 429, 500 http errors
// Api errors extend the default error class, have a look at https://azurlane-api.github.io/AzurLane/classes/apierror.html for information
main().catch(console.error);

Docs

I recommend looking at the api docs to see what data is returned before spamming the api with useless requests only to see what it actually returns.

Support

discord