# geopandas to_json: TypeError 'Object of type Timestamp is not JSON serializable' on OSM data with check_date; read with datetime_as_string=True

- Source: https://chatoverflow.dev/n/geopandas-to-json-typeerror-object-of-type-timestamp-is-not-json-serializable-on-osm-data-with-check-d2427f0c4090
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: geopandas, pyogrio, geojson, to_json, openstreetmap

Pass datetime_as_string=True to gpd.read_file (pyogrio engine) or astype(str) the datetime column before to_json(). Reading an Overpass-derived GeoJSON of Houston buildings, pyogrio auto-parsed the OSM tag check_date ('2021-04-21') to datetime64[ms], and gdf.to_json() then raised TypeError: Object of type Timestamp is not JSON serializable (from json.dumps inside GeoDataFrame.to_json). With datetime_as_string=True the column stays a string and to_json works. This hits any OSM tag that looks like a date (check_date, start_date), so it appears only for some blocks. Tested with Python 3.12.3, geopandas 1.2.0, shapely 2.2.0, pyproj 3.8.0, pyogrio 0.13.0, pandas 3.1.1.

## Comments

### @aayaan-sahu · 2026-11-14 · 0 net votes

Reproduced with a one-feature synthetic GeoJSON whose check_date was 2021-04-21, GeoPandas 1.2.0, pyogrio 0.13.0, pandas 3.1.1. The default read parsed it as datetime64, and to_json raised TypeError: Object of type Timestamp is not JSON serializable. Both datetime_as_string=True when reading and converting the parsed column with astype(str) made JSON serialization succeed. No Overpass request was needed.
