Skip to main content

A simple API for Apple's gs-loc service

Project description

gsloc: Apple Location Service API for Python

This is a Python library and CLI application that provides a reverse engineered implementation of the Apple Location Service API.

This tool is inspired by https://github.com/zadewg/GS-LOC

Installation

pip install gsloc

Usage

Using as a Python library:

from gsloc.core import query

results = query(["94:10:3e:a0:b7:bd"])
for result in results:
    print(result.model_dump())

Using as a command line tool:

gsloc 94:10:3e:a0:b7:bd # you can enter multiple MAC addresses separated by space

Ouput:

 gsloc 94:10:3e:a0:b7:bd
[05/14/24 22:27:22] INFO     2024-05-14 22:27:22,424 - gsloc.core - INFO - Querying Apple location service   core.py:114
                             with MAC addresses: ['94:10:3e:a0:b7:bd']
[05/14/24 22:27:23] INFO     2024-05-14 22:27:23,156 - gsloc.core - INFO - Received response from Apple      core.py:133
                             location service.
[
    WifiInfo(
        mac='94:10:3e:a0:b7:bd',
        channel=153,
        latitude=37.70825195,
        longitude=-122.45568847,
        accuracy=25,
        altitude=98,
        altitude_accuracy=4
    ),
    WifiInfo(
        mac='10:86:8c:45:bc:6e',
        channel=11,
        latitude=37.70871734,
        longitude=-122.45514678,
        accuracy=26,
        altitude=96,
        altitude_accuracy=4
    ),
    WifiInfo(
        mac='1e:9d:72:ca:be:6f',
        channel=1,
        latitude=37.70779037,
        longitude=-122.45628356,
        accuracy=27,
        altitude=105,
        altitude_accuracy=4
    ),
    ...
]

Or, you can provide a list of MAC addresses in a file and write the output to a GeoJSON file:

94:10:3e:a0:b7:bd
10:86:8c:45:bc:6e
...
gsloc -i macs.txt -o output.geojson

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gsloc-0.1.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

gsloc-0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file gsloc-0.1.1.tar.gz.

File metadata

  • Download URL: gsloc-0.1.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gsloc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 66b65b2c1ae1032400e28fd853434e84b4744bd6001bad8deb3e02109a93e38c
MD5 c74120e3a291633ad56808f9f82cc013
BLAKE2b-256 8fceef184e5897b718d3054439ad04cc5d16d385dc8deeac977cef94812559e3

See more details on using hashes here.

File details

Details for the file gsloc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gsloc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for gsloc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f00590dc0b84a227f10fca9fd2948c2f20859aa3a7acff07d4d5a3550fd7ee8d
MD5 37ce7e55beee0ec496353f82d327b8a0
BLAKE2b-256 5341003a830b5cd5e6041f12adc4282a9c7bfa2bef75bd5df7a00f76f1f32a78

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page