

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://amazonaws-china.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# Calling the Data API
<a name="data-api-calling"></a>

You can call the Data API or the Amazon CLI to run SQL statements on your cluster or serverless workgroup. The primary operations to run SQL statements are [https://docs.amazonaws.cn/redshift-data/latest/APIReference/API_ExecuteStatement.html](https://docs.amazonaws.cn/redshift-data/latest/APIReference/API_ExecuteStatement.html) and [https://docs.amazonaws.cn/redshift-data/latest/APIReference/API_BatchExecuteStatement.html](https://docs.amazonaws.cn/redshift-data/latest/APIReference/API_BatchExecuteStatement.html) in the *Amazon Redshift Data API Reference*. The Data API supports the programming languages that are supported by the Amazon SDK. For more information on these, see [Tools to Build on Amazon](https://aws.amazon.com/tools/).

To see code examples of calling the Data API, see [Getting Started with Redshift Data API](https://github.com/aws-samples/getting-started-with-amazon-redshift-data-api#getting-started-with-redshift-data-api) in *GitHub*. This repository has examples of using Amazon Lambda to access Amazon Redshift data from Amazon EC2, Amazon Glue Data Catalog, and Amazon SageMaker Runtime. Example programming languages include Python, Go, Java, and Javascript.

You can call the Data API using the Amazon CLI.

The following examples use the Amazon CLI to call the Data API. To run the examples, edit the parameter values to match your environment. In many of the examples a `cluster-identifier` is provided to run against a cluster. When you run against a serverless workgroup, you provide a `workgroup-name` instead. These examples demonstrate a few of the Data API operations. For more information, see the *Amazon CLI Command Reference*. 

Commands in the following examples have been split and formatted for readability. Not all parameters and responses are shown in all examples. For the API definition of the complete request syntax, request parameters, response syntax, and response elements, see the [Amazon Redshift Data API Reference](https://docs.amazonaws.cn/redshift-data/latest/APIReference/).