Earth2 API Wrapper
A powerful, open-source library for Node.js and Python to interact with the Earth2 API.
Node.js Support
Full TypeScript support for robust, type-safe development in the Node.js ecosystem.
npm install earth2-api-wrapperPython Support
A simple and intuitive Python client, perfect for scripting, data analysis, and backend services.
pip install earth2-api-wrapperPowerful CLI
Access Earth2 data directly from your terminal. Perfect for quick lookups and automation.
# Node.js CLI
e2 trending
e2 property <property-id>
e2 user <user-id>
# Python CLI
e2-py trending
e2-py property <property-id>
e2-py user <user-id>Usage & Examples
import { Earth2Client } from 'earth2-api-wrapper';
// For public endpoints
const client = new Earth2Client();
// For authenticated endpoints
const clientWithAuth = new Earth2Client({
cookieJar: process.env.E2_COOKIE,
csrfToken: process.env.E2_CSRF,
});
async function getTrending() {
const trendingPlaces = await client.getTrendingPlaces();
console.log(trendingPlaces.data);
}
getTrending();Authentication
For endpoints that require authentication (e.g., fetching your favorites or profile-specific data), you must provide your own credentials. The wrapper does not handle logging in for you.
You need to get your Cookie string and X-CSRF-TOKEN from your browser's developer tools after logging into the official Earth2 website.
It is highly recommended to store these as environment variables (E2_COOKIE and E2_CSRF) and not hardcode them in your scripts for security reasons.
How to get your credentials:
- Log in to the official Earth2 website.
- Open your browser's Developer Tools (usually by pressing F12 or right-clicking and selecting "Inspect").
- Go to the "Network" tab.
- Find and click on any recent API request (e.g., a request to r.earth2.io or app.earth2.io).
- In the "Headers" tab for that request, scroll down to "Request Headers".
- Find the cookie header. Copy the entire string value. This is your E2_COOKIE.
- Find the x-csrf-token header. Copy its value. This is your E2_CSRF.
Available API Endpoints
Complete Earth2 API coverage with TypeScript support and rate limiting
Tiles & Pricing1
- →
getTilePricesAll()
Marketplace2
- →
getMarketplace() - →
getMarketFloor()
User Profile5
- →
getUserInfo() - →
getMyNetworth() - →
getMyPreferences() - →
getMyTileCountRankings() - →
searchUsers()
Properties7
- →
getLandfields() - →
getLandfieldDetails() - →
getLandfieldBalanceResources() - →
getLandfieldSettings() - →
getReceivedBids() - →
getSentBids() - →
getStakingCategoriesStats()
Jewels5
- →
getMyJewels() - →
getJewelData() - →
getJewelStacks() - →
getBazaarJewelOffers() - →
getMyBazaarJewelOffers()
Blueprints5
- →
getMyBlueprints() - →
getBazaarBlueprintOffers() - →
getTrendingBlueprintTags() - →
anyBlueprintsForSale() - →
getUserHolobuildingDesigns()
Droids7
- →
getDroids() - →
getDroidLandfields() - →
getDroidRaidInfo() - →
getDroidBuildInfo() - →
getDroidPowerInfo() - →
getDroidsTotalEthers() - →
getBazaarDroidOffers()
Civilians6
- →
getCivilians() - →
getCivilianLandfields() - →
getCivilianFeedInfo() - →
getCivilianSynthesizeInfo() - →
getCivilianEnergySkillPacksInfo() - →
getBazaarCivilianOffers()
Resources12
- →
getMyBalanceResources() - →
getMyResourceBalance() - →
getClaimableEtherAmount() - →
getClaimableStakingYieldEther() - →
getResourceClaims() - →
getMyResourceStakes() - →
getCurrentlyStakedResources() - →
getResourceStakingRates() - →
getMyResourceTransactions() - →
getResourceManagementAssets() - →
getLandfieldsResources()NEW - →
getLandfieldResources()NEW
Leaderboards5
- →
getLeaderboardPlayers() - →
getLeaderboardCountries() - →
getLeaderboardPlayerCountries() - →
getPlayerContinentsLeaderboard() - →
getLandfieldContinentsLeaderboard()
Essence & Crypto5
- →
getEssenceTokenInfo() - →
getEssUsdRate() - →
getMyCryptoPayouts() - →
getMetaMaskWalletConnection() - →
getMyKYCTransactionStatus()
More Features10
- →
getActivities() - →
getQuests() / getMyQuests() - →
getMentars() / getMentarDetails() - →
getAvatarSales() - →
getMyAvatarOwnerships() - →
getYellowEnergyClaims() - →
getTerritoryReleases() - →
getCraftingRecipes() - →
getMediaPlatforms() - →
getLandingMetrics()
v0.3.0 Update - Complete Coverage!
Added 70+ new endpoints! Now with complete Earth2 API coverage including:
- • Resources batch fetching (getLandfieldsResources)
- • All leaderboard types (players, countries, continents)
- • Crafting recipes & territory releases
- • Complete droids, civilians, and jewels APIs
- • Essence token info & crypto payouts
This is an unofficial, community-driven project and is not affiliated with Earth2.
Contribute or report issues on the GitHub repository. GitHub repository