> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/reference/tables/exporting-tables/programmatic.md).

# Programmatic

You can interface with Redivis data programmatically using the Redivis R, Python, and Javascript client libraries, which allow external environments using these programming languages to connect to Redivis, facilitating integration with a wide variety of scientific libraries and paradigms.

These libraries leverage the underlying REST API, which can also be used if you want to connect to Redivis from another programming language.

{% hint style="info" %}
You can also use R and Python to interface with data directly on Redivis, using the integrated [Redivis notebooks](/reference/workflows/notebooks.md). Importantly, the R or Python code that you write in a notebook is the same as what you would write elsewhere, allowing you to easily port your analyses between Redivis and other systems.
{% endhint %}

{% hint style="warning" %}
Note that, if data exports are restricted, you may need to [gain approval to export the table](/reference/data-access/usage-rules.md#requesting-export-approval) before exporting to an external environment.
{% endhint %}

## Python

The **Programmatic** tab in the table export modal contains a code snippet to help you get started in working with Redivis data via Python.

```python
dataset = redivis.organization("Demo").dataset("iris_species")
table = dataset.table("Iris")

table.to_pandas_dataframe()
# 	Id	SepalLengthCm	SepalWidthCm	PetalLengthCm	PetalWidthCm	Species
# 0	33	5.2	        4.1	        1.5	        0.1	        Iris-setosa
# ...

# Other methods to read tabular data:
# table.to_arrow_batch_iterator()
# table.to_arrow_dataset()
# table.to_arrow_table()
# table.to_geopandas_dataframe()
# table.to_dask_dataframe()
# table.to_polars_lazyframe()

# Reading unstructured data from file index tables:
# table.list_files()
# table.download_files()
```

*View the full* [*redivis-python documentation*](/api/client-libraries/redivis-python.md)

## R

The **Programmatic** tab in the table export modal contains a code snippet to help you get started in working with Redivis data via R.

```r
dataset <- redivis$organization("Demo")$dataset("iris_species")
table <- dataset$table("Iris")

table$to_tibble()
# 	Id	SepalLengthCm	SepalWidthCm	PetalLengthCm	PetalWidthCm	Species
# 0	33	5.2	        4.1	        1.5	        0.1	        Iris-setosa
# ...

# Other methods to read tabular data:
# table$to_arrow_batch_reader()
# table$to_arrow_dataset()
# table$to_arrow_table()
# table$to_data_frame()
# table$to_data_table()
# table$to_sf_tibble()

# Reading unstructured data from file index tables:
# table$list_files()
# table$download_files()
```

*View the full* [*redivis-r documentation*](/api/client-libraries/redivis-r.md)

## REST API

The Redivis REST API provides an intuitive, resource-based way to interface with Redivis programmatically. It lets you query, manipulate, and export data and other Redivis resources from any programming language, supporting the workflows and tools best suited to your use case.

```bash
curl --header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    https://redivis.com/api/v1/tables/demo.ghcn_daily_weather_data.stations/rows?format=csv
```

*View the full* [*REST API documentation*](/api/rest-api/general-structure.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.redivis.com/reference/tables/exporting-tables/programmatic.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
