REST API v0.2

API Documentation

Convert IFC and BIM files to geospatial formats programmatically. Full property preservation, automatic CRS detection, 3D geometry, and pipe generation via a simple REST API.

GeoJSONGeoPackageShapefileFile GDB

Quick Start

The fastest way to convert an IFC file is a single curl command. No API key is required for the free tier.

Upload and convert (one-step)
curl -X POST https://api.mightyspatial.com/api/convert \
  -F "file=@model.ifc" \
  -F "output_format=geojson" \
  -o output.geojson
Two-step: Preview then download
# Step 1 — Upload and preview
curl -X POST https://api.mightyspatial.com/api/convert/preview \
  -F "file=@model.ifc" \
  -F "source_crs=EPSG:7856"

# Step 2 — Download using the job_id from Step 1
curl "https://api.mightyspatial.com/api/convert/download/{job_id}?output_format=geopackage" \
  -o output.gpkg
With API key (Pro/Enterprise)
curl -X POST https://api.mightyspatial.com/api/convert/preview \
  -H "X-API-Key: msp_live_your_key_here" \
  -F "file=@model.ifc"

Python SDK

Install the Python SDK for scripting and notebook workflows. Supports direct output to pandas and geopandas DataFrames.

Install
pip install mightyspatial          # core
pip install mightyspatial[geo]     # + geopandas support
pip install mightyspatial[pandas]  # + pandas only
Convert to file
from mightyspatial import convert

# Returns the path to the saved output file
path = convert("building.ifc", output_format="geojson")
path = convert("building.ifc", output_format="geopackage", api_key="ms_...")
Convert to GeoDataFrame
from mightyspatial import to_geodataframe

# Returns a geopandas GeoDataFrame (geometry + attributes)
gdf = to_geodataframe("building.ifc")
gdf = to_geodataframe("building.ifc", api_key="ms_...", source_crs="EPSG:28356")
gdf.plot()
gdf.to_file("output.gpkg", driver="GPKG")
Convert to DataFrame
from mightyspatial import to_dataframe

# Returns a pandas DataFrame (attributes only, no geometry)
df = to_dataframe("building.ifc")
df.head()
df.to_csv("attributes.csv")
Using the client class
from mightyspatial import MightySpatial

ms = MightySpatial(api_key="ms_...")
gdf = ms.to_geodataframe("building.ifc")      # GeoDataFrame
df  = ms.to_dataframe("building.ifc")          # DataFrame
path = ms.convert("building.ifc")              # file path

Authentication

The API uses key-based authentication via the X-API-Key header. Free-tier requests do not require a key.

TierAPI KeyFormats
FreeNot requiredGeoJSON
ProRequiredGeoJSON, GeoPackage, Shapefile
EnterpriseRequiredAll formats (incl. File GDB)

API keys follow the format msp_live_xxxxxxxxxxxx (production) or msp_test_xxxxxxxxxxxx (sandbox).

GET

/api/health

Returns service status and version. Use this to verify the API is reachable.

Response
{
  "status": "ok",
  "version": "0.2.0"
}
curl
curl https://api.mightyspatial.com/api/health
GET

/api/formats

Lists supported output formats and their minimum tier requirements.

Response
{
  "formats": [
    {
      "format": "geojson",
      "extension": ".geojson",
      "mime_type": "application/geo+json",
      "min_tier": "free",
      "description": "GeoJSON (RFC 7946)"
    },
    {
      "format": "geopackage",
      "extension": ".gpkg",
      "mime_type": "application/geopackage+sqlite3",
      "min_tier": "pro",
      "description": "OGC GeoPackage"
    },
    {
      "format": "shapefile",
      "extension": ".shp",
      "mime_type": "application/x-shapefile",
      "min_tier": "pro",
      "description": "Esri Shapefile"
    },
    {
      "format": "filegdb",
      "extension": ".gdb",
      "mime_type": "application/x-filegdb",
      "min_tier": "enterprise",
      "description": "Esri File Geodatabase"
    }
  ]
}
curl
curl https://api.mightyspatial.com/api/formats
POST

/api/convert/preview

Upload an IFC file and receive GeoJSON layers for in-browser preview. Returns a job_id used for subsequent download requests. Layers are cached server-side for 10 minutes.

Parameters

ParameterInTypeRequiredNotes
fileformfileYes.ifc file
source_crsformstringNoEPSG code (e.g. EPSG:7856). Auto-detected if omitted.
split_attributesformstringNoComma-separated attribute names for layer sub-grouping
split_groupsformstringNoJSON object mapping group names to attribute value lists
X-API-KeyheaderstringNoAPI key for Pro/Enterprise tiers
Response
{
  "job_id": "a1b2c3d4e5f6",
  "layers": [
    {
      "name": "LineString",
      "feature_count": 338,
      "geometry_type": "LineString",
      "geojson": {
        "type": "FeatureCollection",
        "features": [...]
      }
    }
  ],
  "available_attributes": ["AssetType", "className", "name"],
  "detected_crs": "EPSG:7856"
}
curl
curl -X POST https://api.mightyspatial.com/api/convert/preview \
  -F "file=@model.ifc" \
  -F "source_crs=EPSG:7856" \
  -F "split_attributes=AssetType,className"

Coordinate system note

All GeoJSON coordinates in the preview response are reprojected to WGS 84 (EPSG:4326) for display. Downloads use the original source CRS.

GET

/api/convert/download/{job_id}

Download the cached conversion result in the requested format.

Parameters

ParameterInTypeRequiredNotes
job_idpathstringYesFrom the preview response
output_formatquerystringNogeojson (default), geopackage, shapefile, filegdb

Response: Binary file download with Content-Disposition header.

curl
curl "https://api.mightyspatial.com/api/convert/download/a1b2c3d4e5f6?output_format=geopackage" \
  -o output.gpkg
POST

/api/convert/download/{job_id}

Download with the current layer structure. The client POSTs its layers array so the download respects any client-side splits, merges, or pipe layers.

Parameters

ParameterInTypeRequiredNotes
job_idpathstringYesFrom the preview response

Request Body (JSON)

FieldTypeDefaultNotes
output_formatstringgeojsongeojson, geopackage, shapefile, filegdb
base_filenamestringoutputBase name for the output file(s)
include_csvbooleanfalseWhen true, bundles CSV exports per layer in a zip archive
layersarray(required)Array of layer objects with name, geometry_type, and features
Request body example
{
  "output_format": "geopackage",
  "base_filename": "my_project",
  "include_csv": false,
  "layers": [
    {
      "name": "LineString",
      "geometry_type": "LineString",
      "features": [...]
    }
  ]
}
POST

/api/convert/pipes/{job_id}

Generate real 3D pipe geometry (MultiPolygon tube surfaces) from polyline features. The tube surface is swept along the 3D centreline with circular cross-sections.

Path Parameters

ParameterInTypeRequiredNotes
job_idpathstringYesFrom the preview response

Request Body (JSON)

FieldTypeDefaultNotes
source_layerstring(required)Name of the source polyline layer
featuresarray(required)GeoJSON Feature dicts from the source layer
diameter_fieldstring|nullnullAttribute name containing pipe diameter values
config_fieldstring|nullnullAttribute for bank/array config (e.g. "2x100;3x150")
uomstringmmUnit of measurement: mm, cm, in, ft, m, km
default_diameternumber300Default diameter when no field is specified
centerline_modestringcenterlinecenterline, topSeam, or bottomSeam
bank_centerline_modestringcenterlineArray/bank reference: centerline, topSeam, bottomSeam
bank_stack_directionstringbottomUpStack direction: bottomUp or topDown
bank_gapnumber50Gap between pipes in the array (in uom units)
bank_expression_schemaobject|nullnullCustom expression template for parsing bank config strings
segmentsinteger8Facets around the tube cross-section (higher = smoother)
Request body example
{
  "source_layer": "LineString",
  "features": [...],
  "diameter_field": "Diameter",
  "config_field": "PipeConfig",
  "uom": "mm",
  "default_diameter": 300,
  "centerline_mode": "centerline",
  "segments": 8
}
Response
{
  "layer": {
    "name": "Pipe3D: LineString",
    "feature_count": 42,
    "geometry_type": "MultiPolygon",
    "geojson": {
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "geometry": {
            "type": "MultiPolygon",
            "coordinates": [...]
          },
          "properties": {
            "AssetType": "SEWER",
            "_pipeDiameter": 0.3,
            "_pipeOffsetRight": 0.0,
            "_pipeOffsetUp": 0.0,
            "_is3DPipe": true
          }
        }
      ]
    }
  }
}
curl
curl -X POST https://api.mightyspatial.com/api/convert/pipes/a1b2c3d4e5f6 \
  -H "Content-Type: application/json" \
  -d '{
    "source_layer": "LineString",
    "features": [...],
    "diameter_field": "Diameter",
    "uom": "mm",
    "default_diameter": 300,
    "segments": 12
  }'

Bank expression schema (Pro feature)

When bank_expression_schema is null, the default fixed format 2x100;3x150 is used (row count x diameter, semicolon-separated). Provide a custom template to parse any format.

Custom bank expression example
{
  "expression": "{diameter}{diameter_uom}{multiplier}{row_width}{new_row}",
  "literals": {
    "multiplier": "*",
    "diameter_uom": "mm",
    "new_row": "|"
  }
}
// Parses: "100mm*2|150mm*3"
POST

/api/convert

Legacy

Upload an IFC file and receive the converted output as a streaming download in a single request. Does not cache layers. For new integrations, prefer the two-step preview/download workflow.

Parameters

ParameterInTypeRequiredNotes
fileformfileYes.ifc file
output_formatformstringNogeojson (default), geopackage, shapefile, filegdb
source_crsformstringNoEPSG code. Auto-detected if omitted.
split_attributesformstringNoComma-separated attribute names for layer sub-grouping
split_groupsformstringNoJSON group mapping (same format as preview endpoint)
strip_prefixformstringNoPrefix to strip from property names (e.g. _12dModel)
strip_suffixformstringNoSuffix to strip from property names
X-API-KeyheaderstringNoAPI key for Pro/Enterprise tiers
curl
curl -X POST https://api.mightyspatial.com/api/convert \
  -F "file=@model.ifc" \
  -F "output_format=geojson" \
  -F "strip_prefix=_12dModel" \
  -o output.geojson

Properties Reference

Standard IFC Properties

Every converted feature includes these base properties:

PropertyTypeDescription
expressIdnumberIFC entity numeric ID
globalIdstringIFC GlobalId (UUID)
classNamestringIFC class name (e.g. IfcPipe, IfcWall)
namestringEntity Name attribute
descriptionstringEntity Description
objectTypestringEntity ObjectType

12d Model Properties

Properties from 12d Model property sets are preserved with their raw names (e.g. _12dModelAssetType). The _12dModel prefix is no longer auto-stripped during upload. To strip prefixes or suffixes on demand, use the strip_prefix and strip_suffix form parameters on the /api/convert endpoint. The frontend also provides a client-side strip tool in the attribute table.

PropertyDescription
_12dModelAssetTypeAsset classification (e.g. TELECOMMUNICATIONS, SEWER)
_12dModelSurveyDatumSurvey datum reference

Pipe Geometry Properties

Properties added to features generated by the pipe geometry endpoint:

PropertyTypeDescription
_pipeDiameternumberPipe diameter in metres
_pipeOffsetRightnumberLateral offset from centreline in metres (bank mode)
_pipeOffsetUpnumberVertical offset from centreline in metres (bank mode)
_is3DPipebooleanAlways true; marks features as generated pipe geometry

Polyline Segment Properties

Features extracted from polyline-based IFC elements include:

PropertyTypeDescription
_parentIdnumberParent entity expressId
_parentTypestringParent entity class name
_segmentIdnumberSegment index within the polyline
_vertexIndexnumberVertex index for point features
_isPolylinebooleanAlways true for polyline-derived features
_segmentCountnumberTotal segments in the parent polyline

Error Codes

All error responses follow a consistent JSON format:

{
  "detail": "Human-readable error message"
}
StatusMeaning
400Bad request (invalid file, no geometry, missing features)
401Missing or invalid API key (for tier-restricted features)
403Tier too low for requested format
404Job not found or expired
413File too large for tier
429Rate limit exceeded
500Internal server error
501Feature not yet implemented

Rate Limits & File Size

Rate limits are applied per IP address (free tier) or per API key (Pro/Enterprise).

TierRate LimitMax File SizePriceOutput Formats
Free5 requests / month25 MBFreeGeoJSON, GeoPackage, Shapefile
Pro100 credits / month500 MB$100 / monthAll (incl. File GDB)
EnterpriseUnlimited2 GBCustomAll (incl. File GDB)

Enterprise plans also include a desktop application and Python library for on-premise deployment, offline conversion, and integration into existing data pipelines.

Subscription pricing: Pro tier is $100/month with 100 credits included (1 credit = 100 MB). Files up to 500 MB are supported — a 500 MB file uses 5 credits. Unused credits roll over for 3 months. Overage is billed at $0.50 per credit. Free tier includes 5 conversions per month (up to 25 MB) — no signup required.

Cache expiry

Preview results are cached server-side for 10 minutes. After expiry, the job_id becomes invalid and you will need to re-upload the file.

Ready to integrate?

Start converting IFC files to GIS formats with a single API call. No signup required for the free tier.