{"id":20454929,"url":"https://github.com/robb-j/appstore-downloads","last_synced_at":"2026-04-14T10:31:11.651Z","repository":{"id":170669439,"uuid":"646880298","full_name":"robb-j/appstore-downloads","owner":"robb-j","description":"A little CLI to get the number of appstore downloads I have","archived":false,"fork":false,"pushed_at":"2023-06-24T10:42:08.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T10:18:50.813Z","etag":null,"topics":["appstoreconnect","deno","docker","kubernetes","typescript"],"latest_commit_sha":null,"homepage":"https://appstore-downloads.r0b.io","language":"TypeScript","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/robb-j.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}},"created_at":"2023-05-29T14:48:19.000Z","updated_at":"2023-05-29T15:01:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e7f4125-cde9-4b93-b0c2-c603e04a3a39","html_url":"https://github.com/robb-j/appstore-downloads","commit_stats":null,"previous_names":["robb-j/appstore-downloads"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/robb-j/appstore-downloads","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robb-j%2Fappstore-downloads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robb-j%2Fappstore-downloads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robb-j%2Fappstore-downloads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robb-j%2Fappstore-downloads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robb-j","download_url":"https://codeload.github.com/robb-j/appstore-downloads/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robb-j%2Fappstore-downloads/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31793212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["appstoreconnect","deno","docker","kubernetes","typescript"],"created_at":"2024-11-15T11:17:23.785Z","updated_at":"2026-04-14T10:31:11.635Z","avatar_url":"https://github.com/robb-j.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AppStore Downloads\n\nA script to get an Apple Developer Account's total app downloads per build\nidentifier with local caching to reduce repeated requests.\n\n## Usage\n\n### Set up\n\nThe scripts are written to be used with [Deno](https://deno.land), so you'll\nneed that installed. You will also need an `AuthKey.p8` which is generated on\nthe App Store Connect website.\n\nTo get your `AuthKey.p8`, go to the \"keys\" section of the\n[App Store Connect](https://appstoreconnect.apple.com/access/api) website.\n\n1. Make a note of your **Issuer ID**, that is needed too\n2. Press the add/plus button to start creating a key\n3. Pick a memorable name\n4. Give it `Sales and reports` access.\n5. Generate and download your p8 file.\n6. Put your p8 file in the same folder as the scripts named `AuthKey.p8`\n7. Take a note of your `KEY ID` too\n8. Make a copy of `.env.example` called `.env` and fill in the variables\n\nYou can also edit `START_DATE` to tell the script how far to go back\n\n### Fetching data\n\nThe `fetch.ts` script runs through and downloads data from the App Store Connect\n`v1/salesReports` endpoint and puts the parsed results into\n[ND-JSON](http://ndjson.org/) files in the `data` directory.\n\n```sh\n# cd to/this/folder\n\ndeno task fetch\n```\n\nand you should get something like this:\n\n```\n┌─────────────────────┬────────┐\n│ (idx)               │ Values │\n├─────────────────────┼────────┤\n│ io.r0b.MiniYubiOath │     41 │\n│ io.r0b.BrowserNow   │     17 │\n└─────────────────────┴────────┘\n```\n\nThe caching works similarly to the data the App Store Connect API returns data.\n\n- For years before the current year, there is a single `yyyy.json` file with all\n  records stored in there.\n- For the current year, there are weekly files up until the current week in\n  `yyyy-mm-dd.json`.\n- For the current week, there are daily files in the same named files as the\n  weekly files.\n- When re-running, the script will concatenate old files together to fit back\n  into the format.\n\n### Serving data\n\nThe `server.ts` script runs a http server that serves the cached results of a\nfetch as a JSON endpoint. There are some flags you can set to configure it a\nbit.\n\n- `--port` — The port to use, defaults to `:8000`\n- `--fetch` — Turn on the fetch. It will run on startup and every 2 hours after\n  that\n\n```\n# cd to/this/folder\n\ndeno task serve\n```\n\nThere are two endpoints\n\n- `/` returns the app store download counts\n- `/healthz` just returns a http 200 to know everything is working\n\nUsing the main endpoint, you should get some json like this:\n\n```json\n{\n  \"io.r0b.BrowserNow\": 17,\n  \"io.r0b.MiniYubiOath\": 41\n}\n```\n\n## Deploying\n\nIf you want to deploy the script as a container, there is a\n[Dockerfile](/Dockerfile) in the repo to describe how to build and run the\nserver with fetching turned on. You'll have to build the image yourself and push\nit to your container registry of choice.\n\nWith a container, there are also some examples Kubernetes manifests in\n[config.yml](/config.yml) to get started with that.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobb-j%2Fappstore-downloads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobb-j%2Fappstore-downloads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobb-j%2Fappstore-downloads/lists"}