Skip to content

dangnames/TollAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Texas Toll Gantry API

Public API and dataset of every toll gantry, plaza, and international toll bridge in Texas — with coordinates, authority, and rates.

Live: https://toll-api.tollmeapi.workers.dev

What's inside

Path What
scrape_toll_gantries.py Scraper that builds the dataset from 30+ authoritative sources
toll_gantries.txt Pipe-delimited database (human-readable)
api/ Cloudflare Worker serving the JSON API
api/src/gantries.json Bundled dataset consumed by the Worker

Coverage

  • 1,155 records across 33 authorities
  • 788 records (68%) have coordinates
  • 511 records (44%) have toll rates
  • Authorities: NTTA, HCTRA, CTRMA, TxDOT (CTTS + SH 99 Grand Parkway + SH 249 Aggie + SH 288 ML), FBCTRA, FBGPTRA, BCTRA, MCTRA, CCRMA, NETRMA, SH130CC, LBJ/NTE TEXpress concessions, every US–MX international toll bridge, and more

API

Base URL: https://toll-api.tollmeapi.workers.dev

Endpoint Description
GET / API info + endpoints
GET /stats Summary counts
GET /authorities List authorities with record counts
GET /roads?authority=NTTA List roads (optional authority filter)
GET /gantries?authority=&road=&plaza_type=&direction=&has_coords=&q=&limit=&offset= Filtered gantry list
GET /gantries/:id Single gantry by OSM id
GET /nearest?lat=&lon=&radius_km=&limit=&authority= Geospatial search
GET /health Healthcheck

Examples

curl https://toll-api.tollmeapi.workers.dev/stats
curl "https://toll-api.tollmeapi.workers.dev/nearest?lat=32.78&lon=-96.80&radius_km=5"
curl "https://toll-api.tollmeapi.workers.dev/gantries?authority=CTRMA&road=183A%20Toll"
curl "https://toll-api.tollmeapi.workers.dev/gantries?q=eldorado"

Open data. CORS enabled. Cache-Control: public, max-age=3600, s-maxage=86400.

Refreshing the data

# one-time setup
python3 -m pip install requests beautifulsoup4 lxml pdfplumber

# scrape + rebuild
python3 scrape_toll_gantries.py     # writes toll_gantries.txt + api/src/gantries.json

# deploy
cd api && npx wrangler deploy

See api/README.md for the Cloudflare deploy details, including a GitHub Actions workflow for weekly auto-refresh.

Data sources

License

Data compiled from public sources. Code is MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors