PSX Lens as your app's backend
Building a mobile or web app without a server of your own? Your app creates its users on PSX Lens and keeps their watchlists and portfolios here. Your users never see a PSX Lens login.
Two keys
- Publishable key (pk_app_…): goes inside your app. It can only sign your own users in or up.
- Server secret (sk_app_…): optional, for apps that do have a server. It manages users by your own ids. Never put it in an app.
Get both in the developer dashboard: register your app, then copy the publishable key. Google sign-in, email codes and anonymous accounts need nothing else.
Option 1: Google sign-in, no server needed
Add Google Sign-In to your app as usual, then paste your app's Google client id (it ends in .apps.googleusercontent.com) into the dashboard. Send the ID token Google gives your app to PSX Lens:
curl -X POST https://api.psxlens.com/v1/apps/users/google \
-H 'x-app-key: pk_app_...' -H 'content-type: application/json' \
-d '{"id_token":"eyJhbGciOiJSUzI1NiIs..."}'
# -> { "data": { "access_token": "pl_live_...", "user_id": "usr_...", "created": true } }The same Google account always comes back to the same user, on any device, so their watchlist follows them.
Option 2: email sign-in code, no server and no passwords
The person types their email in your app and gets a 6 digit code from PSX Lens. Your app sends the code back and gets a token.
curl -X POST https://api.psxlens.com/v1/apps/users/email/start \
-H 'x-app-key: pk_app_...' -H 'content-type: application/json' \
-d '{"email":"person@example.com"}'
curl -X POST https://api.psxlens.com/v1/apps/users/email/verify \
-H 'x-app-key: pk_app_...' -H 'content-type: application/json' \
-d '{"email":"person@example.com","code":"123456"}'
# -> { "data": { "access_token": "pl_live_...", "user_id": "usr_...", "created": true } }The same email always comes back to the same user. Codes last 10 minutes and allow 5 tries. Each email can get 3 codes an hour, and each app can send 200 a day during the free beta. The email comes from noreply@psxlens.com and names your app.
Option 3: an anonymous account per device
For apps that want no sign-in at all. Each call creates a new user; keep the token on the device.
curl -X POST https://api.psxlens.com/v1/apps/users/anonymous -H 'x-app-key: pk_app_...'
Option 4: your own server and user ids
# create the user if new, and get a token for them
curl -X POST https://api.psxlens.com/v1/apps/users/user-42/token \
-H 'authorization: Bearer sk_app_...' -H 'content-type: application/json' \
-d '{"email":"optional@example.com"}'
curl https://api.psxlens.com/v1/apps/users -H 'authorization: Bearer sk_app_...' # list your users
curl -X DELETE https://api.psxlens.com/v1/apps/users/user-42 -H 'authorization: Bearer sk_app_...' # delete one and their dataThen use the token
Every option returns an ordinary access token for that user. Use it with the account endpoints:
curl https://api.psxlens.com/v1/me/watchlist -H 'authorization: Bearer pl_live_...'
curl -X POST https://api.psxlens.com/v1/me/watchlist -H 'authorization: Bearer pl_live_...' \
-H 'content-type: application/json' -d '{"symbol":"OGDC"}'
curl https://api.psxlens.com/v1/me/portfolios -H 'authorization: Bearer pl_live_...'
curl -X POST https://api.psxlens.com/v1/me/transactions -H 'authorization: Bearer pl_live_...' \
-H 'content-type: application/json' -d '{"symbol":"OGDC","type":"buy","quantity":100,"price":310,"date":"2026-11-20"}'The token also reads every market endpoint, with the higher rate limit of 600 requests a minute. See the API reference.
Rules
- Your app sees only the users it created. Other apps cannot reach them, and they cannot sign in on psxlens.com.
- Up to 1,000 users per app during the free beta. Write to us if you need more.
- New sign-ups are limited to 20 an hour from one network address, to stop scripted account creation.
- You are responsible for telling your users that their data is stored with PSX Lens, in your privacy policy.