← Back to Help Center

🦢 Swan Score API Configuration Guide

🦢 Ethical Investment Intelligence System

Philosophy: "Ett viktigt kriterie för mig är att företaget är bra för mänskligheten"

Complete API configuration guide for Swan Score's multi-source ESG data aggregation system with centralized key management and intelligent source-key mapping.

🌱 ESG & Sustainability

Environmental, Social, Governance scoring from multiple validated sources

🔬 Innovation Metrics

R&D spending, technology advancement, and innovation scoring

🏰 Economic Moat

Competitive advantages, market dominance, and financial strength

🤖 Technology Ethics

AI ethics, data privacy, and technology's impact on humanity

🔧 Centralized Management

Save API keys once, use across all Swan Score data sources

🆓 Public APIs

Many sources require no API keys - completely free to use

📊 Swan Score Data Sources Overview

Swan Score uses multiple specialized data sources to create comprehensive ethical investment scores. The system automatically maps your saved API keys to the appropriate services based on your data source selections.

🌱 ESG & Sustainability Data Sources

Select Data Source
Choose API Key
Auto-Configuration

Available Sources:

🌿 Environmental Compliance Sources

Available Sources:

🔬 Innovation & Technology Metrics

Available Sources:

🏰 Economic Moat Analysis

Available Sources:

🤖 Technology Ethics & Impact

Available Sources:

🔑 API Keys & Configuration

💡 Centralized Key Management System

Swan Score uses a smart API key management system where you save each API key once in the API Keys section, then select which key to use for each data source via dropdown menus.

Required API Keys for Full Functionality

📊 Alpha Vantage (Recommended)

🚀 Financial Modeling Prep (Recommended Enhancement)

🔍 OpenFIGI (Optional)

🔧 Step-by-Step Configuration Guide

  1. Open API Configuration Tab

    Navigate to the ⚙️ API Configuration tab in TradePro Portfolio Manager

  2. Configure API Keys (Once)

    Scroll down to the "🦢 Swan Score API Keys" section and save your API keys:

    OpenFIGI API Key: your_openfigi_key (optional) Alpha Vantage: Use existing key from main API Keys section Financial Modeling Prep: Use existing key from main API Keys section

    Note: You only need to save each key once. The system will make them available across all Swan Score data sources.

  3. Configure Swan Score Data Sources

    In the "🦢 Swan Score Data Sources" section, configure each data type:

    • ESG & Sustainability Data: Select your preferred source (Yahoo Finance is free)
    • Environmental Compliance: EPA Envirofacts (free) or European EEA
    • Innovation & Technology: Choose Alpha Vantage or FMP
    • Economic Moat Analysis: Alpha Vantage or FMP for comprehensive data
    • Technology Ethics: Alpha Vantage for news sentiment analysis
  4. Select API Keys for Each Source

    For each data source that requires an API key, use the dropdown to select which saved key to use:

    Source: Alpha Vantage
    Key: Alpha Vantage ✓
    Status: ✅ Connected
  5. Verify Connection Status

    Check the connection status indicators next to each data source:

    • ✅ API Key Available - Ready to use
    • 🆓 Available (Public API) - No key required
    • ❌ No API Key Configured - Needs configuration
  6. Test Swan Score Integration

    Run a stock analysis to test Swan Score functionality:

    1. Go to 📊 Stock Analysis tab
    2. Enter a stock symbol (e.g., AAPL, GOOGL)
    3. Click "Analyze Stock"
    4. Check Analysis Results for Swan Score section

🧮 Swan Score Calculation & Policies

⚖️ "Honest Data" Policy

Important: A Swan Score of 0 (or very low) often indicates missing data or API errors rather than poor ethical performance.

We believe in transparent data. Instead of guessing or filling gaps with averages, we report 0 to alert you that the data source failed or returned no information. Always check the individual component scores to identify which data points are missing.

📐 The Swan Score Formula

The Total Swan Score (0-100) is calculated using a weighted additive model that prioritizes ethical impact:

Total Score = (Innovation * 0.25) + (Moat * 0.25) + (Ethics * 0.50)

Note: This formula ensures that a company must be "good for humanity" (Ethics) to achieve a high score, regardless of its financial dominance.

💡 Best Practices & Tips

⚡ Free API Strategy

To maximize free usage:

🎯 Recommended Configurations

🆓 Completely Free Setup

🚀 Enhanced Setup (Recommended)

💼 Professional Setup

🔧 Troubleshooting

Common Issues & Solutions

❌ "No API Key Configured" Error

Solution:

  1. Save the required API key in the API Keys section
  2. Return to Swan Score data source configuration
  3. Select the saved key from the dropdown
  4. Verify connection status shows ✅

🔄 Dropdown Shows "No API Key Required" Only

This is normal for:

⚡ API Rate Limits Exceeded

Solutions:

🤖 Swan AI Forecast (Live Features)

The Swan AI Forecast module is now fully integrated into the Community Dashboard. It leverages your configured APIs to generate predictive ethical scores with granular visibility.

📊 Granular Breakdown

New in Phase 3: Visual breakdown of the "Swan Score" into 4 key components:

  • Innovation: R&D & Tech Growth
  • Economic Moat: Competitive Advantage
  • Tech Ethics: Data Privacy & AI Safety
  • Environmental: Carbon Footprint & ESG

🧠 Smart Integration

The frontend ML engine (`SwanScoringEngine`) now normalizes data from disparate sources (EPA, Yahoo, World Bank) into a unified 0-100% score, replacing previous simulation data.

📱 Enhanced UI

The new scrollable detailed view allows for deep dives into component scores. The panel automatically calculates component weights when live data is engaged.

🔮 Future Enhancements

👥 Community Validation System

Coming soon: Peer-to-peer ESG validation where the community can validate and score companies based on ethical criteria. This will add human judgment to complement automated ESG scoring.

🌍 Global ESG Expansion

Additional data sources being integrated:

🤖 AI-Enhanced Analysis

Machine learning enhancements in development:

📞 Support & Resources

🦢 Ready to Start Ethical Investing?

With Swan Score API Configuration complete, you now have access to comprehensive ethical investment analysis combining ESG data, innovation metrics, economic moat analysis, and technology ethics assessment.

Next Step: Run your first Swan Score analysis on a stock and see the detailed ethical investment breakdown!