Companion API - Elite Dangerous Official APIΒΆ
OverviewΒΆ
The Elite Dangerous Companion API (CAPI) is the official API provided by Frontier Developments for accessing player account data and game information. This authenticated API allows players to retrieve their commander profile, ship information, and market data directly from the game servers.
Key FeaturesΒΆ
π€ Commander ProfileΒΆ
- Personal commander statistics and rankings
- Career progress and achievement tracking
- Credit balance and asset information
- Reputation and faction standing data
π Fleet ManagementΒΆ
- Current ship configuration and loadout
- Ship storage and fleet inventory
- Module and weapon specifications
- Engineering modifications and effects
π Market DataΒΆ
- Current station market information
- Commodity prices and availability
- Station services and facilities
- Local faction and economic data
π Location TrackingΒΆ
- Current commander location
- Docked station information
- System and galactic position
- Recent travel history
AuthenticationΒΆ
OAuth 2.0 FlowΒΆ
The Companion API uses OAuth 2.0 for secure authentication and authorization.
Authorization ProcessΒΆ
- Registration: Register application with Frontier
- Authorization Request: Redirect user to Frontier login
- User Consent: Player authorizes data access
- Authorization Code: Receive temporary code
- Access Token: Exchange code for API token
- API Access: Use token for authenticated requests
Token ManagementΒΆ
- Access Tokens: Short-lived authentication tokens
- Refresh Tokens: Long-term token renewal capability
- Scope Permissions: Granular access control
- Token Expiration: Automatic security timeout
Security ConsiderationsΒΆ
- HTTPS Only: All communications encrypted
- Rate Limiting: API usage quotas and throttling
- Secure Storage: Token protection requirements
- User Consent: Explicit permission for data access
Available EndpointsΒΆ
Profile DataΒΆ
Access comprehensive commander profile information.
/profileΒΆ
- Commander Details: Name, rank, and basic information
- Statistics: Career achievements and progress
- Reputation: Faction standings and relationships
- Credits: Current balance and financial status
Response DataΒΆ
{
"commander": {
"name": "CMDR Name",
"credits": 150000000,
"rank": {
"combat": 5,
"trade": 7,
"exploration": 6
}
}
}
Fleet InformationΒΆ
Current ship and fleet data.
/fleetΒΆ
- Active Ship: Currently piloted vessel
- Fleet Inventory: All owned ships
- Module Configuration: Detailed loadout information
- Engineering Data: Applied modifications
Ship Data StructureΒΆ
{
"ship": {
"name": "Ship Name",
"shipType": "python",
"modules": {
"PowerPlant": {
"module": "int_powerplant_size6_class5_name",
"engineering": {
"blueprint": "PowerPlant_Armoured",
"level": 5
}
}
}
}
}
Market DataΒΆ
Current station market information when docked.
/marketΒΆ
- Commodity Prices: Buy/sell prices and stock
- Station Services: Available facilities
- Market Conditions: Supply and demand data
- Economic State: Local market conditions
Integration Use CasesΒΆ
Third-Party ApplicationsΒΆ
The Companion API enables rich third-party tool development.
Popular IntegrationsΒΆ
- Ship Builders: Import current loadouts
- Trading Tools: Real-time market data
- Fleet Managers: Comprehensive ship tracking
- Progress Trackers: Achievement monitoring
Mobile ApplicationsΒΆ
- Companion Apps: Remote fleet monitoring
- Market Checkers: Price comparison tools
- Progress Viewers: Career statistics
- Location Trackers: Travel monitoring
Community ToolsΒΆ
- EDMC Integration: Market Connector API usage
- Discord Bots: Commander status reporting
- Web Dashboards: Real-time player data
- Analytics Tools: Progress analysis
Technical ImplementationΒΆ
API Client DevelopmentΒΆ
Guidelines for implementing Companion API clients.
Best PracticesΒΆ
- Token Security: Secure credential storage
- Error Handling: Robust failure recovery
- Rate Limiting: Respect API quotas
- User Privacy: Protect sensitive data
- Offline Support: Cache data appropriately
Common PatternsΒΆ
import requests
class CompanionAPI:
def __init__(self, access_token):
self.token = access_token
self.base_url = "https://companion.orerve.net"
def get_profile(self):
headers = {"Authorization": f"Bearer {self.token}"}
response = requests.get(
f"{self.base_url}/profile",
headers=headers
)
return response.json()
Data ProcessingΒΆ
- JSON Parsing: Standard data format handling
- Error Responses: HTTP status code handling
- Data Validation: Response structure verification
- Caching Strategy: Appropriate data persistence
Limitations & ConsiderationsΒΆ
API RestrictionsΒΆ
- Rate Limiting: Request frequency limitations
- Data Scope: Limited to authenticated player data
- Availability: Dependent on game server status
- Version Changes: API evolution and compatibility
Privacy & SecurityΒΆ
- Personal Data: Sensitive information protection
- User Consent: Explicit permission requirements
- Data Retention: Responsible data handling
- Third-Party Sharing: User control over data use
Development ConsiderationsΒΆ
- Registration Required: Frontier developer account needed
- Usage Approval: Application review process
- Documentation: Limited public documentation
- Community Support: Developer community assistance
Alternative Data SourcesΒΆ
Community APIsΒΆ
When Companion API access is limited, consider community alternatives.
Data SourcesΒΆ
- EDDN: Real-time community data network
- Journal Files: Local game data parsing
- Screen Scraping: Game interface data extraction
- Community Databases: Aggregated player data
Hybrid ApproachesΒΆ
- Primary Source: Companion API for authenticated data
- Fallback Data: Community sources for unavailable information
- Data Validation: Cross-reference multiple sources
- User Choice: Allow users to select data sources
Getting StartedΒΆ
Developer RegistrationΒΆ
- Frontier Account: Create developer account
- Application Registration: Register your application
- API Credentials: Receive client ID and secret
- OAuth Setup: Implement authentication flow
- Testing: Validate integration with test data
Community ResourcesΒΆ
- Developer Forums: Frontier developer community
- Documentation: Official API documentation
- Code Examples: Community-contributed samples
- Support Channels: Developer assistance
Limited Access
The Companion API has restricted access and requires approval from Frontier Developments.
Authentication Required
All API access requires OAuth 2.0 authentication and user consent for data access.
Community Alternatives
Consider EDDN and other community data sources for broader data access needs.