CartoDB API
Oct 27,2026
GISBox is a one-stop 3D GIS data editing, conversion and publishing platform that supports editing in multiple GIS formats such as OSGB/GEOTIFF/RVT, converting to 3DTiles/Terrain and publishing.
Introduction
CartoDB API is a cloud-based geospatial data platform now known as CARTO. Users can store, analyze, and visualize geographic data, and dynamically manipulate spatial data such as points, lines, and polygons through RESTful APIs and SQL queries. It also supports custom map styles (CartoCSS), spatial analysis, and Python integration (such as CARTOframes), and is used in a wide range of fields including urban planning, business intelligence, and data journalism. Its core architecture is based on PostgreSQL and PostGIS, providing a highly scalable cloud-based interactive map service.
File Structure
The file structure of the CartoDB API (now CARTO) spans multiple layers of the development ecosystem, including SDK package organization, configuration files, style files, and project directory structures. Specifically:
- Python SDK (carto-python) module structure: Includes submodules such as sql (SQL queries), tables (table management), visualizations (map visualization), datasets (dataset operations), and api_keys (API key management), provided as an object-oriented API client.
- CartoCSS style file structure: Composed of lib/carto/ (core parsing engine), bin/ (CLI compilation tool), test/ (unit tests), and docs/ (style syntax documentation), capable of compiling CSS styles into Mapnik XML format.
- Self-hosted environment configuration file structure: Includes config/app_config.yml (platform settings such as basemaps, URLs, and public data), config/database.yml (PostgreSQL database connection settings), and .cartorc (user-level API key authentication file).
- Supported data import formats: Accepts various geographic data formats such as CSV, GeoJSON, KML, and Shapefile, with API-parsed data written into the PostGIS database.
- Typical project structure: Composed of src/ (business logic), examples/ (API call samples), tests/ (integration tests), requirements.txt (Python dependencies), and more. Combined with .cartorc, the API can be used without explicit authentication handling.
Pros
- Open-source and easy to use: CartoDB is a fully open-source project and provides a drag-and-drop web interface. Even without programming knowledge, users can upload data and quickly create interactive maps, keeping learning costs low.
- High data processing performance: Built on PostgreSQL and PostGIS, and combined with Varnish and Redis caching, it can efficiently process large-scale geospatial data.
- Rich APIs and integration capabilities: Provides RESTful APIs such as the Maps API and SQL API, supporting SQL-based data queries and CartoCSS-based style customization. Developers can easily embed map functionality into their own applications.
- Support for diverse data formats: Can import geographic data formats such as CSV, GeoJSON, KML, and Shapefile, and also supports geocoding.
- Easy map creation and style customization: In addition to easily generating maps, it offers advanced visualization features such as CartoCSS-based style customization, layer overlays, and heatmaps.
- Active community and abundant adoption cases: Has been used by the Los Angeles Times, The Guardian, Deloitte, and others, with abundant information and resources available from the community.
Cons
- Limited customizability: Particularly with front-end frameworks such as CartoDB.js, complex maps or highly customized map requirements may not be fully met, sometimes requiring additional development.
- Feature limitations on the free plan: The free plan has restrictions on the number of map data tables that can be used, among other things. Output without watermarks, high-resolution use, and large-scale operations may require a paid plan.
- Dependence on cloud services: As a cloud platform, data storage and service usage depend on CARTO's cloud environment. Building a self-hosted environment requires specialized knowledge, and attention must also be paid to data privacy and network latency.
- PostGIS version dependency: Core extensions have PostGIS version requirements (e.g., 2.4 or later), so compatibility must be checked during upgrades and maintenance.
- API concurrent connections and stability: In environments with high concurrent connection loads, API responses may become unstable. Handling large volumes of requests at enterprise scale requires additional performance optimization and operational management.
Application Scenario
CartoDB API is widely used for visualizing and analyzing spatial data such as traffic volume and population distribution in urban planning and smart city construction. In the data journalism and media fields, it has been used for interactive map-based reporting by outlets such as The Guardian and The New York Times. Furthermore, in business intelligence, it can be used for retail store location selection, logistics route optimization, and market heatmap analysis. It is also suitable for scenarios requiring processing and online display of large-scale geospatial data, such as environmental monitoring, infectious disease tracking in public health, and agricultural resource management.
Example
1. Example of using CartoFrames.

File Opening Mode
1. Sample image opened in CARTO.
Related GIS Services
LocationIQ API
Geoapify Maps & Location API
Stadia Maps API
Thunderforest Maps API
References
- https://api-docs.carto.com/
- https://gisgeography.com/carto/
- https://carto.com/blog/from-cartodb-to-carto/