{"id":17442765,"url":"https://github.com/twang2218/mobile-locator","last_synced_at":"2025-06-29T15:32:36.370Z","repository":{"id":54254156,"uuid":"57972338","full_name":"twang2218/mobile-locator","owner":"twang2218","description":"Get Geolocation information based on Cell base station information","archived":false,"fork":false,"pushed_at":"2021-03-02T13:08:58.000Z","size":171,"stargazers_count":78,"open_issues_count":2,"forks_count":35,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-01-02T16:55:21.867Z","etag":null,"topics":["api","cell","cellocation","geolocation","google","gpsspg","gsm","haoservice","location","mozilla","mylnikov","opencellid","unwired","unwiredlabs","yandex"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twang2218.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-03T13:44:04.000Z","updated_at":"2024-12-31T02:10:49.000Z","dependencies_parsed_at":"2022-08-13T10:10:23.235Z","dependency_job_id":null,"html_url":"https://github.com/twang2218/mobile-locator","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twang2218%2Fmobile-locator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twang2218%2Fmobile-locator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twang2218%2Fmobile-locator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twang2218%2Fmobile-locator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twang2218","download_url":"https://codeload.github.com/twang2218/mobile-locator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233080322,"owners_count":18622020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cell","cellocation","geolocation","google","gpsspg","gsm","haoservice","location","mozilla","mylnikov","opencellid","unwired","unwiredlabs","yandex"],"created_at":"2024-10-17T16:29:22.050Z","updated_at":"2025-01-08T18:32:27.976Z","avatar_url":"https://github.com/twang2218.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mobile Locator\n\n[![NPM version][npm-version-image]][npm-url]\n[![MIT License][license-image]][license-url]\n[![Build Status][travis-image]][travis-url]\n[![Dependency Status][dependency-image]][dependency-url]\n[![Coverage Status][coverage-image]][coverage-url]\n[![NPM][npm-classy-badge-image]][npm-classy-badge-url]\n\n[license-image]: http://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat\n[license-url]: LICENSE.txt\n\n[npm-url]: https://npmjs.org/package/mobile-locator\n[npm-version-image]: http://img.shields.io/npm/v/mobile-locator.svg?style=flat\n[npm-downloads-image]: http://img.shields.io/npm/dm/mobile-locator.svg?style=flat\n[npm-classy-badge-image]: https://nodei.co/npm/mobile-locator.png?downloads=true\u0026downloadRank=true\u0026stars=true\n[npm-classy-badge-url]: https://nodei.co/npm/mobile-locator/\n\n[travis-url]: http://travis-ci.org/twang2218/mobile-locator\n[travis-image]: http://img.shields.io/travis/twang2218/mobile-locator.svg?style=flat\n\n[dependency-url]: https://gemnasium.com/twang2218/mobile-locator\n[dependency-image]: http://img.shields.io/gemnasium/twang2218/mobile-locator.svg\n\n[coverage-url]: https://coveralls.io/github/twang2218/mobile-locator?branch=master\n[coverage-image]: https://coveralls.io/repos/github/twang2218/mobile-locator/badge.svg?branch=master\n\nGet geolocation from cell tower information.\n\nCurrently, the following APIs are implemented:\n\n- `cellocation`: [Cellocation.com API (China)](http://www.cellocation.com/interfac/)\n- `gpsspg`: [GPSspg.com API (China)](http://www.gpsspg.com/api/bs/)\n- `google`: [Google Geolocation API](https://developers.google.com/maps/documentation/geolocation/intro)\n- `haoservice`: [HaoService.com API (China)](http://www.haoservice.com/docs/1)\n- `mozilla`: [Mozilla Geolocation API](https://location.services.mozilla.com/api)\n- `mylnikov`: [Mylnikov Geolocation API](https://www.mylnikov.org/archives/1059)\n- `opencellid`: [OpenCellID API](http://opencellid.org/)\n- `unwiredlabs`: [UnwiredLabs Location API](https://unwiredlabs.com/)\n- `yandex`: [Yandex Geolocation API (Russian)](https://tech.yandex.ru/locator/doc/dg/api/geolocation-api_json-docpage/)\n\n# Library\n\n## api(name, options)\n\nCreate the location engine by given name and options.\n\n*Name*  | *Options*\n--- | ---\n `cellocation` | `system`_(optional)_: Coordinate system: `wgs84`_(Default)_, `gcj02`, `bd09`.\n `google` | `key`: Google API key\n `gpsspg` | `key`: GPSspg API key, \u003cbr\u003e `oid`: GPSspg OID,\u003cbr\u003e `system`_(optional)_: Coordinate system: `0`:wgs84_(Default)_; `1`:gcj02; `2`:bd09; `3`:QQ Maps; `4`:MapBar\n `haoservice` | `key`: HaoService API key, \u003cbr\u003e `system`_(optional)_: Coordinate system: `0`: gcj02; `1`:bd09; `2`:wgs84_(Default)_\n `mozilla` | `key`: Mozilla API key\n `mylnikov` | `data`_(optional)_: `open`: Use open source data.\n `opencellid` | `key`: OpenCellID API key\n `unwiredlabs` | `token`: UnwiredLabs Location API token\n `yandex` | `key`: Yandex API key\n\nBesides the above engine-specific options,  more general options are also available:\n\n- `verbose`: Print more debug information if `verbose` is `true`;\n- `timeout`: Set the timeout value in milliseconds. There is no timeout by default.\n\nThe returned value is a `locate()` function, which will be described in the next section.\n\n## locate(info)\n\n`info` should contain cell information, including `mnc`, `mcc`, `lac` and `cid`.\n\nThe function will return a promise, which will return the `location` from given geolocation service.\n\n`location` is an object contains following properties:\n\n*Property*  | *Description*\n--- | ---\n `longitude` | Longitude\n `latitude` | Latitude\n `accuracy` | The accuracy range of the given position\n `address`(optional) | For some API, this property contains the human readable address line.\n\n## Example\n\n```javascript\nconst api = require('mobile-locator');\n\nconst locate = api('google', { key: YOUR_GOOGLE_API_KEY });\n\nlocate({ mcc: 460, mnc: 0, lac: 4219, cid: 20925 })\n  .then(location =\u003e console.log(JSON.stringify(location, null, 2)));\n```\n\nThe output would be:\n\n```javascript\n{\n  longitude: 116.46679499999998,\n  latitude: 39.9910226,\n  accuracy: 606\n}\n```\n\n# Command-line Interface\n\nUsage\n\n```bash\n$ mobile-locator -h\n\nUsage: mobile-locator [options]\n\nLocate geolocation information based on Cell base station data\n\nOptions:\n\n  -h, --help                   output usage information\n  -V, --version                output the version number\n  -c, --cell \u003ccell\u003e            Cell tower base station information in format \"MCC,MNC,LAC,CID\". \"-c 460,0,4219,20925\"\n  -e, --engine \u003cengine\u003e        Geolocation service engine. {cellocation, google, gpsspg, haoservice, mozilla, mylnikov, opencellid, unwiredlabs, yandex}. Default: google\n  -a, --arguments \u003carguments\u003e  Arguments for geolocation engine. e.g. \"key:XXX,oid:123\".\n  -m, --map \u003cmap\u003e              Map service. {google, bing, openstreetmap, google.cn, bing.cn, baidu}.\n  -v, --verbose                Verbose output.\n\nExamples:\n\n  $ mobile-locator -a \"key:XXX\" -c 460,0,4219,20925\n  $ mobile-locator -e cellocation -a \"system:bd09\" -m baidu -c 460,0,4219,20925\n\n```\n\nBy default, the Google Geolocation engine will be used.\n\n```bash\n$ mobile-locator -a \"key:GOOGLE_API_KEY\" -c 460,0,4219,20925\n{\"longitude\":116.46679499999998,\"latitude\":39.9910226,\"accuracy\":606}\n```\n\nWith verbose option:\n\n```bash\n$ mobile-locator -a \"key:AIzaSyAL2sfTLqUv9Rb3ercbtuu__PG2pS_4eDo\" -c 460,0,4219,20925 -v\nGeolocation engine: \"google\"\nCell: {\"mcc\":\"460\",\"mnc\":\"0\",\"lac\":\"4219\",\"cid\":\"20925\"}\nLocation: {\"longitude\":116.46679499999998,\"latitude\":39.9910226,\"accuracy\":606}\n```\n\nMore complex example:\n\n- Use `cellocation` engine;\n- Choose `bd09` coordinate system;\n- Show Baidu map url for given coordinate;\n- Verbose output.\n\n```bash\n$ mobile-locator -e cellocation -a 'system:bd09' -m baidu -v -c 460,0,4219,20925\nGeolocation engine: \"cellocation\"\nCell: {\"mcc\":\"460\",\"mnc\":\"0\",\"lac\":\"4219\",\"cid\":\"20925\"}\nLocation: {\"longitude\":\"116.479653\",\"latitude\":\"39.997967\",\"accuracy\":\"100\",\"address\":\"北京市朝阳区望京街道望京园402号楼;广顺南大街与阜安西路路口东北109米\"}\nMap url: http://api.map.baidu.com/marker?location=39.997967,116.479653\u0026title=_\u0026content=北京市朝阳区望京街道望京园402号楼;广顺南大街与阜安西路路口东北109米\u0026output=html\u0026autoOpen=true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwang2218%2Fmobile-locator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwang2218%2Fmobile-locator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwang2218%2Fmobile-locator/lists"}