Skip to content

An opencellid server using bottle and bottle-sqlalchemy

Notifications You must be signed in to change notification settings

janjongboom/opencellid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self hosted OpenCellID server

An OpenCellID HTTP server, inspired by the original work from Frédéric Junod. You'll want to use this if you either don't want to rely on OpenCellID to stay online, or when you're a commercial user of OpenCellID.

If you're interested in this project, you are probably also interested in transmeyer's cell-geolocation project. It combines OpenCellID with other data sources.

Install

Download and create an sqlite database from the csv data that you can get from https://opencellid.org/downloads/. The thing is that it now requires a login, so the best way is to download it from browser and store it as cells.txt.gz in this folder. If you want to run this on a server then use Firefox Network panel and 'copy as cURL'. Then run that command on the server and store as cells.txt.gz.

Then run:

cat cells.txt.gz | gunzip - > cells.txt
cat schema.sql | sqlite3 cells.sqlite
cat import.sql | sqlite3 cells.sqlite

Running

Start the server

npm install
node opencellid.js

Use environment variables PORT and IP for different port/host. F.e.:

PORT=1337 node opencellid.js

Query

curl -s 'https://localhost:5265/?mcc=228&mnc=1&lac=505&cellid=10545'

The outout is a JSON object that has lat, lon and range.

License

Released under the WTFPL version 2.

About

An opencellid server using bottle and bottle-sqlalchemy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%