# Markdown Table Generator (`visita/markdown-table-generator`) Actor

This Actor converts data from multiple sources into a clean, presentation-ready table. You can provide raw text, a direct URL to a file (like `.xlsx` or `.csv`), or Run ID of another Apify Actor, and this tool will automatically format it into Markdown, HTML, or Confluence Wiki markup.

- **URL**: https://apify.com/visita/markdown-table-generator.md
- **Developed by:** [Visita Intelligence](https://apify.com/visita) (community)
- **Categories:** SEO tools, Developer tools, Other
- **Stats:** 12 total users, 0 monthly users, 93.5% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 📊 Table Generator

This Actor is a powerful utility that **converts data from multiple sources** into a clean, presentation-ready table. You can provide raw text, a direct URL to a file (like `.xlsx` or `.csv`), or even the **Run ID of another Apify Actor**, and this tool will automatically format it into **Markdown, HTML, or Confluence Wiki** markup.

### ✨ What can this Table Generator do?

This tool is more than a simple converter. It's a complete solution for formatting data for your reports, documentation, and websites.

- **🔁 Works with any Actor:** Provide the Run ID of any Actor (e.g., a scraper) to instantly generate a table of its results.
- **📥 Multiple Data Sources:** Accepts data from a **File URL**, **pasted Raw Text**, or an **Actor Run ID**.
- **⚙️ Smart Parsing:** Automatically parses the most common data formats, including **Excel (.xlsx), CSV, JSON, and TSV**.
- **📤 Multiple Output Formats:** Generates tables in **Markdown**, **HTML**, or **Confluence Wiki Markup**.
- **🎯 Pro-Level Control:** Lets you **select specific columns** to include in your table and (for Markdown) **set the text alignment** for each column individually.
- **🚀 Built on Apify:** As an Apify Actor, it runs in the cloud, can be scheduled, and can be integrated with other tools via the Apify API.

### 🚀 How do I use the Table Generator?

It's simple to get started:

1. Go to the **Input** tab (you'll see a user-friendly form thanks to the emojis 😉).
2. Select your data source:
   - **🔁 Source Actor Run ID:** Paste the Run ID of a previous Actor run.
   - **🌐 URL:** Paste a direct URL to an `.xlsx`, `.csv`, or `.json` file.
   - **📝 Raw Text:** Paste your data directly into the text field.
3. (Optional) Specify which **`🎯 Select Columns`** you want to include (e.g., `Product,Price,SKU`).
4. (Optional) Set your **`📏 Column Alignments`** for Markdown (e.g., `left,right,center`).
5. Choose your desired **`📤 Output Format`** (Markdown, HTML, or Confluence).
6. Click **"Start"** and wait for the run to finish.
7. Go to the **"Output"** tab to get your generated table!

### 💰 How much will it cost?

This Actor uses the **pay-per-event (PPE)** pricing model. You are charged a small fee for each table successfully generated.

A single run that produces one table counts as **one `apify-default-dataset-item` event**. The Apify Free plan includes a monthly platform credit, which means you can generate many tables for free before incurring any charges.

### 📥 Input and 📤 Output Examples

#### Input Example

The Actor has a simple UI, but here is what a typical run using a File URL would look like in JSON:

```json
{
    "dataSource": "url",
    "fileUrl": "https://my-data.com/report.xlsx",
    "columns": "Product,Price,SKU",
    "columnAlignments": "left,right,left",
    "outputFormat": "markdown"
}
```

#### Output Example

The Actor saves its result as a single item in the **Output** tab. You can download this data in JSON, CSV, Excel, etc.

```json
[
  {
    "output_format": "markdown",
    "generated_table": "| Product | Price | SKU |\n| :--- | ---: | :--- |\n| SuperSlippers | 29.99 | SLIP-001 |\n| MegaMug | 15.50 | MUG-002 |"
  }
]
```

### Advanced Tips: Automate Your Reports

The most powerful feature of this Actor is its ability to connect with other Actors. You can create a fully automated reporting pipeline:

1. **Run any scraper** on the Apify Store (e.g., Google Maps Scraper).
2. Once it's finished, copy its **Run ID**.
3. Paste that ID into the `🔁 Source Actor Run ID` field of this Actor.
4. This will automatically pull the dataset from that scraper and convert it into a clean table for your reports or project `README.md` files.

You can even **schedule** this Actor to run *after* your scraper finishes to have a formatted report ready for you every morning.

### ❓ FAQ & Support

- **What if my Excel file has multiple sheets?**

  - Currently, the Actor only reads the **first sheet** of an Excel file.

- **What if my data has nested JSON?**

  - The Actor works best with flat, 2D data (like a spreadsheet). If you use a `sourceRunId` with nested JSON, it will do its best, but complex objects might not look right. Use the `🎯 Select Columns` feature to pick the simple, top-level fields you need.

- **Have questions or found a bug?**

  - Please use the **Issues** tab on the Actor's page in Apify Console to report bugs or request features.

# Actor input Schema

## `sourceRunId` (type: `string`):

Optional: An Actor Run ID. If provided, this Actor will fetch the dataset from that run and convert it, ignoring all other data source inputs.

## `dataSource` (type: `string`):

Select the source of your data.

## `rawData` (type: `string`):

Paste your raw CSV, TSV, or JSON (array of objects) data here. Only used if Data Source is 'Raw Text'.

## `fileUrl` (type: `string`):

A direct URL to a .csv, .json, .tsv, or .xlsx file. Only used if Data Source is 'URL'.

## `fileType` (type: `string`):

Manually specify the raw text format. 'auto' will try to guess.

## `dataHasHeader` (type: `boolean`):

For CSV/TSV: Check this if the first line of your data is the header.

## `columns` (type: `string`):

Optional: Comma-separated list of column names to include (e.g., Product,Price,SKU). Leave empty to include all.

## `columnAlignments` (type: `string`):

A single value (left, center, right) OR a comma-separated list (e.g., left,right,center). Only used for Markdown output.

## `outputFormat` (type: `string`):

Select the format for the generated table.

## Actor input object example

```json
{
  "sourceRunId": "",
  "dataSource": "rawText",
  "rawData": "header1,header2\nvalue1,value2",
  "fileUrl": "",
  "fileType": "auto",
  "dataHasHeader": true,
  "columns": "",
  "columnAlignments": "left",
  "outputFormat": "markdown"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("visita/markdown-table-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("visita/markdown-table-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call visita/markdown-table-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=visita/markdown-table-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/CBZLiaeqRoqJAhwLt/builds/UcIOXmovbFgBs8n4W/openapi.json
