If you want any outside tool to read your App Store sales, you'll need an App Store Connect API key. Apple's docs cover it, but they're written for people who already know what they're doing. This guide is for everyone else.
By the end you'll have a working key, you'll know which role to pick, and you'll know how to avoid the three mistakes that cause almost every "invalid credentials" error.
What an API key actually is
An App Store Connect API key is a way for software to talk to Apple on your behalf, without your password. Instead of logging in, the tool signs each request with a private key file that only you have. Apple checks the signature and answers.
A key comes in four pieces:
- Issuer ID. Identifies your team. It's a long ID with hyphens.
- Key ID. Identifies this specific key. It's a short 10 character code.
- The .p8 file. The private key itself. This is the secret part.
- Vendor Number. Not part of the key, but needed to download sales and finance reports.
We break each one down in more detail in Issuer ID, Key ID and .p8 explained.
Who can create a key
You need to be the Account Holder or an Admin on the App Store Connect team. If you're a solo developer, that's you. If you're on a company team and don't see the option, ask whoever set up the developer account.
The very first time a team uses the API, the Account Holder may need to request access. If you see a Request Access button instead of a plus sign, that's what's happening. Submit the request and come back once it's approved.
Step by step
- Sign in to App Store Connect.
- Go to Users and Access.
- Open the Integrations tab.
- Choose App Store Connect API in the sidebar.
- Make sure you're on Team Keys, not Individual Keys.
- Click the plus button next to Active.
- Give the key a name you'll recognize later, like the name of the tool.
- Pick the access role. More on that below.
- Click Generate.
- Download the .p8 file right away.
Team Keys vs Individual Keys
This one catches a lot of people. Apple offers two kinds of keys. Individual Keys are tied to one person, and Apple doesn't let them read sales or finance reports. If you want sales data, you need a Team Key. If you made an individual key by mistake, just go back and create a team key instead.
Which role should you pick?
The role decides what the key can read. For analytics, two roles matter:
- Sales and Reports. Downloads, revenue, proceeds, refunds, countries, devices and products. This is enough for most developers.
- Finance. Everything in Sales and Reports, plus Apple's settled financial reports, payments and fiscal periods. Pick this if you want to see payouts.
Here's the important part: Apple locks a key's role when it's created. You can't edit it later. If you start with Sales and Reports and decide you want payouts, you just create a second key with Finance. Nothing breaks.
Both roles are read-only for reporting. Neither one lets a tool change your apps, prices or metadata. Avoid giving analytics tools an Admin key. They don't need it, and you shouldn't hand out more access than a job requires.
Download the .p8 right now
Apple shows the download link for the private key exactly once. If you close that page without downloading it, the file is gone forever. You'd have to revoke the key and make a new one.
Save the file somewhere you won't lose it. On iPhone, the Files app works great. On a Mac, a password manager that supports file attachments is even better. Don't email it to yourself, don't paste it in Slack, and never commit it to a Git repo.
The three mistakes that break keys
Almost every failed connection comes down to one of these:
- Mismatched Key ID and .p8. Each .p8 file belongs to exactly one Key ID. If you've made a few keys, it's easy to pair the wrong ones. Check that the Key ID in the file name matches the Key ID you pasted.
- Wrong Issuer ID. The Issuer ID lives above the keys table on the Team Keys page. People sometimes paste their Team ID or Apple ID instead.
- An individual key. As we covered above, these can't read sales reports.
If you're connecting AppScope, the app makes one test request to Apple before it saves anything, so you'll know right away if something's off.
Next: find your Vendor Number
To download sales reports you also need your Vendor Number. It's not on the API page. Head to Payments and Financial Reports, and you'll see it under your legal entity name. Our Vendor Number guide shows exactly where to look.
Put the key to work
Once you have all four pieces, you can connect a tool like AppScope and see your downloads, revenue, MRR and payouts on your iPhone in a couple of minutes. The setup guide walks through it with pictures.
And when you're done, take thirty seconds to read our guide on keeping your API key safe. A little care now saves a lot of stress later.