# Enable the Data API

SingleStore’s Data API is accessible via a built-in HTTP server. The Data API is enabled by default. When the Data API is enabled, it will be hosted on a port that is different from the SingleStore Helios port.

## Test the Data API

Call the `GET /ping` API request to verify that the HTTP service is running and connectable. To perform this action using cURL, make a `GET` request to the `/ping` endpoint with no parameters:

```shell
curl https://svc-XXXX-dml.aws-ireland-1.svc.singlestore.com/ping
```

If the Data API service is available and is able to respond to requests, you will receive the following response along with a *200 OK* status code, indicating a successful HTTP response.

```shell
ping
```

If an error occurs, you will receive one of the [HTTP response status codes](https://docs.singlestore.com/cloud/reference/data-api/data-api-error-handling.md), along with the error description in the response body. For more information, refer to the [Data API Endpoint Reference](https://docs.singlestore.com/cloud/reference/data-api/data-api-endpoint-reference.md).

The `GET /ping` request can only verify whether the HTTP service is running and connectable. To verify that the database can receive queries, use the `/exec` and `/query` endpoints.

The following cURL command makes a `POST` API request to the `/query/rows` endpoint. (Replace `root:password` in the HTTP request with your SingleStore `username:password` string.)

```shell
curl -H "Content-Type: application/json" --data '{"sql": "select 1+1"}' --user 'root:password' https://svc-XXXX-dml.aws-ireland-1.svc.singlestore.com/api/v2/query/rows
```

If the API call is successful, you should see the following results along with a *200 OK* status code.

```JSON
{"results":[{"rows":[{"1+1":2}]}]}

```

If an error occurs, you will receive one of the [HTTP response status codes](https://docs.singlestore.com/cloud/reference/data-api/data-api-error-handling.md), along with the error description in the response body. For more information, refer to the [Data API Endpoint Reference](https://docs.singlestore.com/cloud/reference/data-api/data-api-endpoint-reference.md).

If you format the JSON output with a formatting tool, the results appear as follows. (Recommended JSON formatting tools: [jq](https://stedolan.github.io/jq/), [JSONLint](https://jsonlint.com/))

```JSON
{
  "results": [
    {
      "rows": [
        {
          "1+1": 2
        }
      ]
    }
  ]
}
```

**Note**: The `GET /ping` request should be used in automated health checks. To verify specific health metrics, use the `/exec` and `/query` endpoints.

***

Modified at: July 18, 2024

Source: [/cloud/reference/data-api/enable-the-data-api/](https://docs.singlestore.com/cloud/reference/data-api/enable-the-data-api/)

(An index of the documentation is available at /llms.txt)
