Graph Swiss API
    • Introduction
    • Quickstart
    • Authentication
    • Base URL
    • Errors
    • Request ID
    • Conventions
    • API
      • Health
        • Liveness probe
      • Companies
        • Search companies
        • AI-powered company search
        • Get company by ID
        • Get company journal summaries
        • Get full SHAB journal texts
        • Get detailed company report
      • Persons
        • Search persons
        • Get person by ID
      • Stocks
        • List active Swiss stock symbols
        • Get real-time stock quote
        • Get current stock price
        • Get historical OHLCV data
        • Get latest end-of-day data
        • Get company profile and statistics
        • Get income statement, balance sheet, and cash flow
        • Get key executives for a stock
    • Schemas
      • StockSymbol
      • Error
      • StockQuote
      • Company
      • StockPrice
      • CompanyDetail
      • StockHistoryValue
      • Code
      • StockHistory
      • CompanyWithRelations
      • StockEod
      • CompanyListPage
      • StockProfile
      • Person
      • StockIncomeStatement
      • ShabJournal
      • StockBalanceSheet
      • PersonCompanyLink
      • StockCashFlow
      • PersonWithCompanies
      • StockFinancials
      • PersonListPage
      • StockKeyExecutive

    Errors

    Graph Swiss API returns errors in a single, predictable JSON envelope. The HTTP status code tells you the broad category; the code field tells you the exact reason.

    Error envelope#

    {
      "success": false,
      "error": "Human-readable message",
      "code": "MACHINE_READABLE_CODE"
    }
    Some errors carry extra context fields. The most common shapes:

    Validation errors#

    A failed input validation returns HTTP 400 with an issues array. Each issue points to the offending field path and a message.
    {
      "success": false,
      "error": "Validation failed",
      "code": "VALIDATION_ERROR",
      "issues": [
        { "path": "body.email", "message": "Invalid email" },
        { "path": "query.limit", "message": "Expected number, received string" }
      ]
    }

    Unhandled internal errors#

    If the API hits an unexpected failure, you'll get HTTP 500 and the response includes the request ID so you can quote it in a support ticket.
    {
      "success": false,
      "error": "Internal server error",
      "code": "INTERNAL_ERROR",
      "request_id": "0f4b2e2e-9c2a-4d2c-8b91-3a86d5f6f1c7"
    }

    Code reference#

    Authentication and credits#

    CodeHTTPWhen it fires
    MISSING_API_KEY401The X-API-Key header was not sent.
    INVALID_KEY401The key is malformed or unknown.
    KEY_REVOKED401The key was valid but has been revoked.
    KEY_EXPIRED401The key has expired.
    SUBSCRIPTION_REQUIRED402Your plan does not cover this endpoint.
    FEATURE_UNAVAILABLE402This feature is not enabled on your plan.
    INSUFFICIENT_CREDITS402Your wallet balance cannot cover this call.
    SCOPE_MISMATCH403The key is valid but lacks scope for this endpoint.
    RATE_LIMIT_EXCEEDED429Too many requests in the current window. Back off.
    AUTHORIZATION_FAILEDvariesGeneric fallback when the upstream auth check rejected the request without a recognized code.

    Request and resource#

    CodeHTTPWhen it fires
    VALIDATION_ERROR400Request failed schema validation. The issues array tells you which fields.
    BAD_REQUEST400Request was syntactically valid but semantically wrong.
    NOT_FOUND404The requested resource does not exist.

    Upstream and gateway#

    CodeHTTPWhen it fires
    UPSTREAM_4XX502A backing service rejected our request with a 4xx. Usually a misconfiguration on our side — retry won't help.
    UPSTREAM_5XX502A backing service returned 5xx. We've already retried internally; if you still see this, the service is broken.
    UPSTREAM_TIMEOUT504A backing service did not respond in time. Safe to retry with backoff.
    UPSTREAM_UNAVAILABLE503A backing service is unreachable. Try again shortly.
    INTERNAL_ERROR500Unhandled internal error. Capture the request_id and report it.

    How to react#

    ClassRecommended action
    MISSING_API_KEY, INVALID_KEY, KEY_REVOKED, KEY_EXPIREDFix the key. Don't retry.
    INSUFFICIENT_CREDITS, SUBSCRIPTION_REQUIREDTop up credits or upgrade plan, then retry.
    RATE_LIMIT_EXCEEDEDWait until the X-RateLimit-Reset window, then retry.
    4xx (other)Fix the request. Don't retry until you do.
    UPSTREAM_TIMEOUT, UPSTREAM_UNAVAILABLERetry with exponential backoff (e.g. 200 ms, 400 ms, 800 ms). Cap at 3–5 attempts.
    UPSTREAM_5XXOne retry is reasonable; we've already retried internally.
    UPSTREAM_4XXDon't retry — this signals an issue on our side. Report the request_id.
    INTERNAL_ERRORCapture request_id and contact support.

    Refunds on failed requests#

    When the gateway returns 5xx, the credits charged for that request are automatically refunded to your wallet. You only pay for requests that successfully reach the upstream service.

    Always log the request ID#

    Every error response carries an X-Request-Id header. Log it on your side. It's the single piece of information that lets us trace the failure end-to-end. See Request ID.
    Modified at 2026-05-01 06:35:44
    Previous
    Base URL
    Next
    Request ID
    Built with