Discover all dataflows that have data for a given code.
Use this as your starting point when exploring what data exists for a
country, indicator, or any other code. For example, to find everything
available for Fiji: find_code_usage_across_dataflows("FJ", dimension_id="GEO_PICT").
Searches all constraints in a single API call.
**When to use this tool:**
- "What datasets have data for Vanuatu?" -> code="VU", dimension_id="GEO_PICT"
- "Which dataflows cover GDP indicators?" -> code="GDP", dimension_id="INDICATOR"
- "What data exists for this country across all topics?" -> start here, then use
compare_dataflow_dimensions() to check how the discovered dataflows relate.
**Workflow A -- search by dimension (direct):**
find_code_usage_across_dataflows("FJ", dimension_id="GEO_PICT")
Returns only matches where "FJ" appears in the GEO_PICT dimension.
**Workflow B -- search by codelist (two steps):**
If you know a code belongs to a codelist (e.g., CL_COM_GEO_PICT) but
not which dimensions use it:
1. Call this tool WITHOUT dimension_id to get all dataflows/dimensions
where the code appears.
2. For each matched dataflow, call get_dataflow_structure() to inspect
the DSD and verify which codelist each matched dimension uses.
**Provider support:** Bulk search requires endpoint support. Currently
supported by SPC (Actual), ECB (Allowed), and UNICEF (Actual). Other
endpoints will return a message explaining the limitation.
Args:
code: The specific code to check (e.g., "FJ")
dimension_id: Optional dimension to restrict search (e.g., "GEO_PICT").
If provided, only matches in this dimension are returned.
If omitted, all dimensions are searched.
agency_id: The agency (uses session endpoint if not specified)
endpoint: Optional endpoint key (e.g. "FBOS", "ECB") to target a
specific provider for this call only. Defaults to the session's
current endpoint.
Returns:
CrossDataflowCodeUsageResult with:
- dataflows_with_data: Dataflows where code is actually used
- summary: Counts of usage