OpenBB-finance/OpenBB · error · Error

Unsupported file format. Please use .json or .env files.

Error message

Unsupported file format. Please use .json or .env files.

What it means

Raised by the Intrinio Market Snapshots fetcher when the Intrinio 'securities/snapshots' endpoint returns a JSON body containing an 'error' key instead of the expected 'snapshots' list. The message text is forwarded verbatim from Intrinio's response ('error' and 'message' fields), so the upstream API diagnosed the request as invalid. This is OpenBB's way of surfacing an upstream API failure rather than silently returning no data.

Source

Thrown at desktop/src/routes/api-keys.tsx:127

							// Remove surrounding quotes if present
							if (
								(value.startsWith('"') && value.endsWith('"')) ||
								(value.startsWith("'") && value.endsWith("'"))
							) {
								value = value.slice(1, -1);
							}

							newKeys.push({
								key,
								value,
								required: false,
							});
						}
					}
				}
			} else {
				throw new Error(
					"Unsupported file format. Please use .json or .env files.",
				);
			}

			if (newKeys.length > 0) {
				setImportedKeys(newKeys);
				setSelectedKeys(new Set(newKeys.map((k) => k.key)));
				setIsImportConfirmModalOpen(true);
			} else {
				setError("No new keys found in the imported file.");
			}
		} catch (err) {
			console.error("Error parsing file:", err);
			setError(
				`Error parsing file: ${err instanceof Error ? err.message : String(err)}`,
			);
		}
	};

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Verify the Intrinio credential is set: `openbb.credentials.intrinio_api_key = '...'` (or env var INTRINIO_API_KEY), then retry — an empty key is sent as `api_key=` when credentials are None.
  2. Test the key directly against the API: curl 'https://api-v2.intrinio.com/securities/snapshots?api_key=YOUR_KEY' and confirm the response contains 'snapshots' rather than an error object.
  3. Confirm your Intrinio subscription includes the Security Snapshots endpoint; upgrade or switch provider (e.g. yfinance) if it does not.
  4. If passing a date, use an explicit ISO datetime like '2024-03-08T12:15:00-0500'; historical coverage only goes back to mid-June 2022 per the field description.
  5. Read the forwarded 'Error: ... Message: ...' text — it is Intrinio's own diagnosis (e.g. 'Invalid API Key', 'Access Denied') and points at the exact fix.

Example fix

# before
obb.user.credentials.intrinio_api_key = None  # or unset
res = obb.equity.market_snapshots(provider='intrinio')  # -> Error: ..., Message: ...

# after
obb.user.credentials.intrinio_api_key = os.environ['INTRINIO_API_KEY']
res = obb.equity.market_snapshots(provider='intrinio')
Defensive patterns

Strategy: try-catch

Validate before calling

import obb
from openbb_core.app.model.abstract.error import OpenBBError

# Validate credentials exist before calling the API
creds = obb.user.credentials
if not getattr(creds, 'intrinio_api_key', None):
    raise ValueError('intrinio_api_key is not set - call obb.user.credentials.intrinio_api_key = ... first')

Type guard

def is_intrinio_api_error(exc: Exception) -> bool:
    """True when OpenBB forwarded an upstream Intrinio API error."""
    return isinstance(exc, OpenBBError) and str(exc).startswith('Error:') and 'Message:' in str(exc)

Try / catch

from openbb_core.app.model.abstract.error import OpenBBError

try:
    res = obb.equity.market_snapshots(provider='intrinio')
except OpenBBError as e:
    msg = str(e)
    if 'Invalid API Key' in msg or 'Access' in msg:
        # credential problem - fix key/subscription, do not retry
        raise
    # other upstream errors may be transient
    raise

Prevention

When it happens

Trigger: Calling `equity.market_snapshots(provider='intrinio')` (optionally with a `date` param) when GET https://api-v2.intrinio.com/securities/snapshots?api_key=...&at_datetime=... responds with an error JSON. Typical upstream causes: missing/empty/invalid `intrinio_api_key` (api_key='' is literally interpolated into the URL when credentials are absent), an API key without the required Intrinio real-time/security-master entitlement, or a malformed `at_datetime` value produced by transform_query (line 128-134 mangles '+' into '-').

Common situations: Missing INTRINIO_API_KEY environment variable or OpenBB credential ('intrinio_api_key' not set), a free-tier key that lacks snapshots access, expired/rotated API key, passing a date string that survives pydantic validation but is rejected by Intrinio, or running behind a proxy that returns a JSON error body.

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/223049a0c3d3cf7b. Report an issue: GitHub.