Configuration¶
gopro-api uses pydantic-settings to load settings from the environment and from a .env file in the current working directory.
Required settings¶
| Variable | Description |
|---|---|
GP_ACCESS_TOKEN |
Your GoPro cloud access token (the value of the gp_access_token browser cookie). |
.env file¶
Create a .env file at the root of your project (or wherever you run the CLI from):
Never commit .env
Add .env to your .gitignore. The token grants full access to your GoPro cloud account.
Overriding the token in code¶
Pass the token directly when constructing a client — this takes precedence over the environment:
from gopro_api.api import GoProAPI, AsyncGoProAPI
with GoProAPI(access_token="your_token_here") as api:
...
async with AsyncGoProAPI(access_token="your_token_here") as api:
...
Retrieving gp_access_token from your browser¶
Sign in to gopro.com or quik.gopro.com. The site sets a cookie named gp_access_token.
- Open the site while logged in.
- Press F12 to open DevTools → Application tab → Cookies → select the origin (e.g.
https://quik.gopro.com). - Copy the Value of
gp_access_token.
- Press F12 → Storage tab → Cookies → select the origin.
- Copy the Value of
gp_access_token.
- Open DevTools → Network tab.
- Trigger any request to
api.gopro.com(e.g. browse your media library). - Click on the request → Headers → scroll to Request Headers → Cookie.
- Copy the value after
gp_access_token=up to the next;(or end of the string).
HttpOnly cookies
If the cookie is HttpOnly, the Application panel will not show its value. Use the Network panel method instead.
Token expiry¶
Tokens expire. If you receive a 401 Unauthorized error, return to your browser and copy a fresh token value.
Check whether your current token is still valid:
API reference¶
See gopro_api.config for the Settings class that loads these values.