{"id":51126530,"url":"https://github.com/apiverve/moon-tracker-python-tutorial","last_synced_at":"2026-06-25T08:01:57.789Z","repository":{"id":338751650,"uuid":"1158997574","full_name":"apiverve/moon-tracker-python-tutorial","owner":"apiverve","description":"Moon position tracker that calculates altitude, azimuth, and distance using Python","archived":false,"fork":false,"pushed_at":"2026-02-16T07:40:52.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-16T15:19:10.264Z","etag":null,"topics":["apiverve","astronomy","celestial","cli","coordinates","moon","moon-tracker","python","tutorial"],"latest_commit_sha":null,"homepage":"https://apiverve.com/marketplace/moonposition","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apiverve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-16T07:20:58.000Z","updated_at":"2026-02-16T07:40:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/apiverve/moon-tracker-python-tutorial","commit_stats":null,"previous_names":["apiverve/moon-tracker-python-tutorial"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/apiverve/moon-tracker-python-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fmoon-tracker-python-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fmoon-tracker-python-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fmoon-tracker-python-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fmoon-tracker-python-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apiverve","download_url":"https://codeload.github.com/apiverve/moon-tracker-python-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiverve%2Fmoon-tracker-python-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34765322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["apiverve","astronomy","celestial","cli","coordinates","moon","moon-tracker","python","tutorial"],"created_at":"2026-06-25T08:01:57.717Z","updated_at":"2026-06-25T08:01:57.777Z","avatar_url":"https://github.com/apiverve.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moon Position Tracker | APIVerve API Tutorial\r\n\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\r\n[![Build](https://img.shields.io/badge/Build-Passing-brightgreen.svg)]()\r\n[![Python](https://img.shields.io/badge/Python-3.8+-3776ab)](https://python.org)\r\n[![APIVerve | Moon Position](https://img.shields.io/badge/APIVerve-Moon_Position-purple)](https://apiverve.com/marketplace/moonposition?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=moon-tracker-python-tutorial)\r\n\r\nA Python CLI tool to track the moon's position in the sky. Get altitude, azimuth, and distance from any location on Earth.\r\n\r\n![Screenshot](https://raw.githubusercontent.com/apiverve/moon-tracker-python-tutorial/main/screenshot.jpg)\r\n\r\n---\r\n\r\n### Get Your Free API Key\r\n\r\nThis tutorial requires an APIVerve API key. **[Sign up free](https://dashboard.apiverve.com?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=moon-tracker-python-tutorial)** - no credit card required.\r\n\r\n---\r\n\r\n## Features\r\n\r\n- Track moon position from any coordinates\r\n- Altitude above/below horizon\r\n- Azimuth with compass direction\r\n- Distance to the moon\r\n- Support for custom date/time\r\n- Pre-configured example locations\r\n- Interactive CLI interface\r\n\r\n## Quick Start\r\n\r\n1. **Clone this repository**\r\n   ```bash\r\n   git clone https://github.com/apiverve/moon-tracker-python-tutorial.git\r\n   cd moon-tracker-python-tutorial\r\n   ```\r\n\r\n2. **Install dependencies**\r\n   ```bash\r\n   pip install -r requirements.txt\r\n   ```\r\n\r\n3. **Set your API key**\r\n   ```bash\r\n   export APIVERVE_API_KEY=your-api-key-here\r\n   ```\r\n\r\n4. **Run the tracker**\r\n   ```bash\r\n   python tracker.py\r\n   ```\r\n\r\n## Project Structure\r\n\r\n```\r\nmoon-tracker-python-tutorial/\r\n├── tracker.py          # Main Python script\r\n├── requirements.txt    # Python dependencies\r\n├── screenshot.jpg      # Preview image\r\n├── LICENSE             # MIT license\r\n├── .gitignore          # Git ignore rules\r\n└── README.md           # This file\r\n```\r\n\r\n## How It Works\r\n\r\n1. Select a location or enter coordinates\r\n2. Optionally specify date and time\r\n3. API calculates moon's position\r\n4. Display altitude, azimuth, and distance\r\n\r\n### The API Call\r\n\r\n```python\r\nresponse = requests.get('https://api.apiverve.com/v1/moonposition',\r\n    headers={'x-api-key': API_KEY},\r\n    params={\r\n        'lat': 37.7749,\r\n        'lon': -122.4194,\r\n        'date': '01-22-2026',\r\n        'time': '14:30'\r\n    }\r\n)\r\n```\r\n\r\n## API Reference\r\n\r\n**Endpoint:** `GET https://api.apiverve.com/v1/moonposition`\r\n\r\n**Query Parameters:**\r\n\r\n| Parameter | Type | Required | Description |\r\n|-----------|------|----------|-------------|\r\n| `lat` | number | Yes | Latitude (-90 to 90) |\r\n| `lon` | number | Yes | Longitude (-180 to 180) |\r\n| `date` | string | No | Date (MM-DD-YYYY format) |\r\n| `time` | string | No | Time (HH:MM format) |\r\n\r\n**Example Response:**\r\n\r\n```json\r\n{\r\n  \"status\": \"ok\",\r\n  \"error\": null,\r\n  \"data\": {\r\n    \"date\": \"01-22-2026\",\r\n    \"time\": \"14:30\",\r\n    \"coordinates\": {\r\n      \"latitude\": 37.7749,\r\n      \"longitude\": -122.4194\r\n    },\r\n    \"moon\": {\r\n      \"altitude\": -0.407908976399288,\r\n      \"azimuth\": 1.4720499058762104,\r\n      \"distance\": 404332.68340679689\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n## Understanding the Data\r\n\r\n| Field | Description |\r\n|-------|-------------|\r\n| `altitude` | Angle above/below horizon (radians). Positive = visible |\r\n| `azimuth` | Compass direction (radians from north) |\r\n| `distance` | Distance to moon in kilometers |\r\n\r\n### Converting Radians to Degrees\r\n\r\n```python\r\ndegrees = radians * (180 / 3.14159)\r\n```\r\n\r\n## Example Locations\r\n\r\n| Location | Latitude | Longitude |\r\n|----------|----------|-----------|\r\n| San Francisco | 37.7749 | -122.4194 |\r\n| New York | 40.7128 | -74.0060 |\r\n| London | 51.5074 | -0.1278 |\r\n| Tokyo | 35.6762 | 139.6503 |\r\n\r\n## Customization Ideas\r\n\r\n- Add moon phase data\r\n- Create visualization graph\r\n- Add sunrise/sunset comparison\r\n- Build web interface\r\n- Track multiple celestial bodies\r\n- Add notification for moonrise\r\n\r\n## Related APIs\r\n\r\nExplore more APIs at [APIVerve](https://apiverve.com/marketplace?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=moon-tracker-python-tutorial):\r\n\r\n- [Moon Phases](https://apiverve.com/marketplace/moonphases?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=moon-tracker-python-tutorial) - Current moon phase\r\n- [Sun Position](https://apiverve.com/marketplace/sunposition?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=moon-tracker-python-tutorial) - Track the sun\r\n- [Sunrise Sunset](https://apiverve.com/marketplace/sunrisesunset?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=moon-tracker-python-tutorial) - Daily sun times\r\n\r\n## Free Plan Note\r\n\r\nThis tutorial works with the free APIVerve plan. Some APIs may have:\r\n- **Locked fields**: Premium response fields return `null` on free plans\r\n- **Ignored parameters**: Some optional parameters require a paid plan\r\n\r\nThe API response includes a `premium` object when limitations apply. [Upgrade anytime](https://dashboard.apiverve.com/plans) to unlock all features.\r\n\r\n## License\r\n\r\nMIT - see [LICENSE](LICENSE)\r\n\r\n## Links\r\n\r\n- [Get API Key](https://dashboard.apiverve.com?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=moon-tracker-python-tutorial) - Sign up free\r\n- [APIVerve Marketplace](https://apiverve.com/marketplace?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=moon-tracker-python-tutorial) - Browse 300+ APIs\r\n- [Moon Position API](https://apiverve.com/marketplace/moonposition?utm_source=github\u0026utm_medium=tutorial\u0026utm_campaign=moon-tracker-python-tutorial) - API details\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiverve%2Fmoon-tracker-python-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapiverve%2Fmoon-tracker-python-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiverve%2Fmoon-tracker-python-tutorial/lists"}