# Libraries and APIs

## Libraries

### `deck.gl`

**deck.gl** is an open source JavaScript (and TypeScript) based visualization library designed for large-scale geospatial datasets. It's powered by WebGL2 and WebGPU, achieving incredible visual results with high performance. It's part of the vis.gl framework, integrated into the [OpenJS Foundation](https://openjsf.org/). CARTO is a lead contributor as well as a member of the technical steering committee of deck.gl.

To visualize geospatial data from CARTO in a custom web application, you need to use deck.gl.

* [deck.gl Documentation](https://deck.gl/docs)
* [deck.gl on Github](https://github.com/visgl/deck.gl)
* [deck.gl on NPM](https://www.npmjs.com/package/deck.gl)

```bash
npm install deck.gl
```

### `@deck.gl/carto`

Inside deck.gl, we maintain our **CARTO module**, which provides all the necessary layers and styling functions to create and style [deck.gl](#deck.gl) layers from your CARTO connections.

* [@deck.gl/carto Documentation](https://deck.gl/docs/api-reference/carto/overview)
* [@deck.gl/carto on Github](https://github.com/visgl/deck.gl)
* [@deck.gl/carto on NPM](https://www.npmjs.com/package/@deck.gl/carto)

```bash
npm install @deck.gl/carto
```

### `@carto/api-client`

**@carto/api-client** is a JavaScript (and TypeScript) client library for CARTO APIs and framework-agnostic [CARTO + deck.gl](https://docs.carto.com/carto-for-developers/carto-for-deck.gl) web applications.

* [@carto/api-client Documentation](/carto-for-developers/reference.md)
* [@carto/api-client on Github](https://github.com/CartoDB/carto-api-client)
* [@carto/api-client on NPM](https://www.npmjs.com/package/@carto/api-client)

```bash
npm install @carto/api-client
```

### `@carto/agentic-deckgl`

**@carto/agentic-deckgl** is a framework-agnostic TypeScript library for building AI-powered map experiences on top of CARTO and deck.gl. It provides tool definitions, system prompt generation, and SDK converters that allow an LLM to control a deck.gl map through natural language — adding layers, navigating, placing markers, and applying spatial filters.

* [@carto/agentic-deckgl Documentation](/carto-for-developers/reference/agentic-deckgl.md)
* [@carto/agentic-deckgl on Github](https://github.com/CartoDB/carto-agentic-deckgl)
* [@carto/agentic-deckgl on NPM](https://www.npmjs.com/package/@carto/agentic-deckgl)

```bash
npm install @carto/agentic-deckgl
```

***

## APIS

### `SQL API`

CARTO SQL API v3 lets you run arbitrary queries in external data warehouses using an existing connection in your CARTO organization.

[Link to API Reference](https://api-docs.carto.com/#95aa64ca-128c-4c2c-b156-aa417260050e)

### `Tokens API`

The CARTO Tokens API allows the creation API Access Tokens that grant access to specific tables, tilesets and arbitrary queries using a specific connection in your CARTO organization.

An API Access Token allows to create map layers and fetch data from tables, tilesets or arbitrary SQL queries in public applications.

[Link to API Reference](https://api-docs.carto.com/#b060994a-8dc2-4c87-8358-d3b6a7d08c5e)

### `Connections API`

CARTO Connections API allows for programmatically managing (create, list, delete, or update) your connections to an external Data Warehouse

[Link to API Reference](https://api-docs.carto.com/#b6f716d5-40b4-464f-b16c-6ed5aff01d23)

### `Imports API`

CARTO Imports API allows the creation of geospatial tables in an organization's CARTO Data Warehouse by importing files via URL. Once a file is imported, the resulting table can be previewed in Data Explorer and used in Builder and external applications to create maps.

When using the `carto_dw` connection in your CARTO organization it will create tables in your organization's data shared folder. Learn more about CARTO Data Warehouse [here](https://docs.carto.com/carto-user-manual/connections/carto-data-warehouse/).

Currently, supported file formats are CSV, GeoJSON, GeoParquet and Shapefile; This last one needs to be packaged in a .zip file.

Other supported Data Warehouses are BigQuery, Snowflake, Amazon Redshift and PostgreSQL

There is a size limit to the files that can be imported. It's currently set at 1GB. [Let us know](mailto:support@carto.com) if you need a higher limit.

[Link to API Reference](https://api-docs.carto.com/#d8fea1d4-2f80-4270-a684-75fd83b10426)

### `Location Data Services (LDS API)`

CARTO Location Data Services API provides access to the following services:

* Geocoding: Get coordinates from a street address
* Batch geocoding: Get coordinates from a list of street addresses
* Reverse geocoding: Get a street address from a pair of coordinates
* Isolines: Get isoline geometries for different methods of transportation.
* Routing: Get routing geometries for different methods of transportation

[Link to API Reference](https://api-docs.carto.com/#f70786a4-8d69-46f3-9794-4e021ab43df8)

### `Maps API`

{% hint style="info" %}
The **Maps API** is an API designed to be used by the [CARTO module in deck.gl](#deck.gl-carto) ([@deck.gl/CARTO](https://deck.gl/docs/api-reference/carto/overview)). It is used to retrieve map tiles using CARTO in your deck.gl applications.

As a developer you don't need to integrate this API manually in your application.
{% endhint %}

### API rate limits

Our SaaS platform is protected with a web application firewall (WAF) that will automatically and temporarily block any IP that exceeds our API rate limits. Said API rate limits are:

* **Maps API:** 3500 requests/minute
* **SQL API:** 2500 requests/minute
* **LDS API:** 3000 requests/minute
* **Import API:** 500 requests/minute
* **Tokens API**: 300 requests/minute
* **Connections API:** 100 requests/minute

Cached requests (answered by our CDN) do not count towards this rate limit.

CARTO APIs will send a `429` HTTP response if the API request is over this limit.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.carto.com/carto-for-developers/key-concepts/apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
