Build applications that interact with the Rotten Legacy ecosystem. Our comprehensive API allows you to access game data, integrate with the RTN Network, and create tools for players.
The Rotten Legacy API provides developers with access to game data, player information, and blockchain functionality. This documentation will help you integrate your applications with the Rotten Legacy ecosystem.
All API endpoints are accessible through the following base URL:
https://api.rotten.test/v1
The API accepts request data in JSON format for POST, PUT, and PATCH requests. Include the following header in all requests:
{
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
}
All responses are returned in JSON format. Successful responses include a data
object containing the requested information. Error responses include an error
object with details about what went wrong.
{
"status": "success",
"data": {
"id": "p123456",
"username": "WastelandWarrior",
"level": 42,
"faction": "the-dawn",
"created_at": "2025-01-15T08:23:42Z",
"last_active": "2025-05-06T10:17:22Z"
}
}
{
"status": "error",
"error": {
"code": "auth_required",
"message": "Authentication is required to access this resource",
"status": 401
}
}
All timestamps are returned in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) and are in UTC timezone.
The Rotten Dawn API uses API keys to authenticate requests. You can obtain an API key from your Developer Dashboard.
Authentication is performed by including your API key in the Authorization header of each request. API keys are bound to specific permissions and rate limits based on your developer tier.
Authorization: Bearer YOUR_API_KEY
Keep your API keys secure and do not share them publicly. If you believe your key has been compromised, you should revoke it immediately from your Developer Dashboard and generate a new one.
For applications that need to access user data, we provide OAuth 2.0 authentication. This allows users to grant your application permission to access their data without sharing their credentials.
The OAuth flow consists of the following steps:
Redirects the user to the Rotten Dawn authorization page.
Parameter | Type | Required | Description |
---|---|---|---|
client_id | string | Yes | Your application's client ID |
redirect_uri | string | Yes | URL to redirect to after authorization |
scope | string | Yes | Space-separated list of permissions |
response_type | string | Yes | Must be set to "code" |
state | string | No | Random string to prevent CSRF attacks |
Exchanges an authorization code for an access token.
Parameter | Type | Required | Description |
---|---|---|---|
client_id | string | Yes | Your application's client ID |
client_secret | string | Yes | Your application's client secret |
code | string | Yes | The authorization code received from the /authorize endpoint |
redirect_uri | string | Yes | Must match the redirect_uri used in the /authorize request |
grant_type | string | Yes | Must be set to "authorization_code" |
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"scope": "read:profile write:inventory"
}
The Player API allows you to access and manage player information, including profiles, inventory, and statistics.
Retrieve player profile data, including basic information, faction affiliation, and current status.
Retrieves detailed information about a specific player.
Parameter | Type | Required | Description |
---|---|---|---|
player_id | string | Yes | Unique identifier for the player |
{
"status": "success",
"data": {
"id": "p123456",
"username": "WastelandWarrior",
"profile": {
"avatar_url": "https://assets.rotten.test/avatars/p123456.png",
"level": 42,
"experience": 78945,
"faction": {
"id": "the-dawn",
"name": "The Dawn",
"rank": "Trusted"
},
"created_at": "2025-01-15T08:23:42Z",
"last_active": "2025-05-06T10:17:22Z",
"location": {
"region": "abandoned-city",
"coordinates": [145.23, -78.91],
"safe_zone": false
}
},
"status": {
"online": true,
"health": 87,
"radiation": 12,
"hunger": 65,
"thirst": 72
}
}
}
Updates a player's profile information. Requires OAuth authentication with the write:profile
scope.
Parameter | Type | Required | Description |
---|---|---|---|
player_id | string | Yes | Unique identifier for the player |
{
"avatar_url": "https://assets.rotten.test/avatars/custom/p123456.png",
"settings": {
"notifications": {
"email": true,
"push": false,
"in_game": true
},
"privacy": {
"show_online_status": true,
"share_inventory": false,
"share_location": true
}
}
}
Here are some examples of how to use the Rotten Dawn API with different programming languages:
// Fetching Player Profile with JavaScript
const fetchPlayerProfile = async (playerId) => {
try {
const response = await fetch(`https://api.rotten.test/v1/players/${playerId}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
});
if (!response.ok) {
throw new Error(`API Error: ${response.status}`);
}
const data = await response.json();
console.log('Player Profile:', data);
return data;
} catch (error) {
console.error('Error fetching player profile:', error);
throw error;
}
};
// Example usage
fetchPlayerProfile('p123456')
.then(profile => {
// Handle the player profile data
updateUIWithPlayerData(profile.data);
})
.catch(error => {
// Handle errors
showErrorMessage(error.message);
});
# Fetching Player Profile with Python
import requests
def fetch_player_profile(player_id, api_key):
"""Fetch a player's profile from the Rotten Dawn API"""
url = f"https://api.rotten.test/v1/players/{player_id}"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
try:
response = requests.get(url, headers=headers)
response.raise_for_status() # Raise an exception for 4XX/5XX status codes
data = response.json()
print(f"Successfully fetched profile for player {player_id}")
return data
except requests.exceptions.HTTPError as http_err:
print(f"HTTP Error: {http_err}")
return None
except requests.exceptions.RequestException as err:
print(f"Request Error: {err}")
return None
# Example usage
if __name__ == "__main__":
API_KEY = "YOUR_API_KEY"
player_profile = fetch_player_profile("p123456", API_KEY)
if player_profile and player_profile.get("status") == "success":
# Process player data
player_data = player_profile["data"]
print(f"Player: {player_data['username']}, Level: {player_data['profile']['level']}")
else:
print("Failed to retrieve player profile")
# Fetching Player Profile with cURL
curl -X GET "https://api.rotten.test/v1/players/p123456" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY"
# Updating Player Profile with cURL
curl -X PUT "https://api.rotten.test/v1/players/p123456/profile" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"avatar_url": "https://assets.rotten.test/avatars/custom/p123456.png",
"settings": {
"notifications": {
"email": true,
"push": false,
"in_game": true
},
"privacy": {
"show_online_status": true,
"share_inventory": false,
"share_location": true
}
}
}'
To simplify integration with the Rotten Dawn API, we provide official SDKs for popular programming languages and platforms. These SDKs handle authentication, requests, and response parsing, allowing you to focus on building your application.
Official JavaScript SDK for browser and Node.js applications. Includes TypeScript support and full API coverage.
Official Python SDK with synchronous and asynchronous API support. Compatible with Python 3.7+.
Official Unity SDK for game development. Provides seamless integration with Unity projects and supports WebGL, mobile, and desktop platforms.
Create a developer account to get your API keys and start building applications that integrate with the Rotten Dawn ecosystem.
Build innovative applications with our comprehensive set of APIs and integration tools.
Access player profiles, inventory data, statistics, and activity information to create personalized experiences for Rotten Dawn players.
Connect with the Rotten Dawn marketplace to build trading applications, price trackers, and inventory management tools.
Interact with the RTN Network blockchain to create wallet applications, NFT viewers, and token management tools.
Access location data, faction territories, and world events to build interactive maps and community planning tools.
Retrieve game statistics and economic data to create dashboards, visualizations, and trend analysis tools.
Receive real-time notifications for in-game events, marketplace transactions, and player activities.
© 2025 Rotten Legacy. All rights reserved.