---
name: metabase_execute_card
kind: function
lang: py
domain: infra
version: "1.0.0"
purity: impure
signature: "def metabase_execute_card(client: MetabaseClient, card_id: int, parameters: list[dict] | None = None) -> dict"
description: "Ejecuta la query de una card guardada y retorna resultados con columnas y filas. Soporta parametros. Endpoint: POST /api/card/:id/query."
tags: [metabase, card, question, execute, query, api, python, pendiente-usar, extractor]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: [httpx]
params:
  - name: client
    desc: "instancia autenticada de MetabaseClient"
  - name: card_id
    desc: "ID de la card guardada a ejecutar"
  - name: parameters
    desc: "lista de parámetros para la query (filtros dinámicos)"
output: "dict: resultados con status, row_count, running_time, data.columns, data.rows"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/metabase/cards.py"
---

## Ejemplo

```python
result = metabase_execute_card(client, 42)
for row in result["data"]["rows"]:
    print(row)
```

## Notas

Respuesta: status, row_count, running_time, data.columns, data.rows, data.cols.
Limite default: 2000 filas. Para ad-hoc sin card usar metabase_execute_query.
