Quickstart
1. Create a key
Section titled “1. Create a key”Open the Developer Portal in the AfterLib app, create an API key, and store the full al_live_... value somewhere secure.
API keys are shown once. If a key is exposed, revoke it and create another one.
2. Check the account
Section titled “2. Check the account”export AFTERLIB_API_KEY="al_live_replace_me"
curl https://api.afterlib.com/v1/account \ -H "Authorization: Bearer $AFTERLIB_API_KEY"3. Check credits
Section titled “3. Check credits”curl https://api.afterlib.com/v1/credits \ -H "Authorization: Bearer $AFTERLIB_API_KEY"4. Search ads
Section titled “4. Search ads”curl https://api.afterlib.com/v1/ads/search \ -H "Authorization: Bearer $AFTERLIB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "running shoes", "limit": 10 }'5. Work with collections
Section titled “5. Work with collections”List collections first:
curl https://api.afterlib.com/v1/collections \ -H "Authorization: Bearer $AFTERLIB_API_KEY"Then read ads from a collection:
curl "https://api.afterlib.com/v1/collections/00000000-0000-0000-0000-000000000000/items?itemType=ads&limit=25" \ -H "Authorization: Bearer $AFTERLIB_API_KEY"Add an ad to a collection:
curl https://api.afterlib.com/v1/collections/00000000-0000-0000-0000-000000000000/items \ -X POST \ -H "Authorization: Bearer $AFTERLIB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "itemType": "ads", "itemId": "1234567890" }'The collections guide covers page collections and idempotent add behavior.
Next steps
Section titled “Next steps”- Use examples and recipes for plain JavaScript, TypeScript, and Python examples.
- Use request logs when a response includes an error or an unexpected credit charge.
- Use the API reference for exact request and response fields.