Quickstart

From zero to your first API call in under a minute.

1

Register and get credentials

Go to the Dashboard, sign up with your email, and click "Generate API Credentials".

You'll receive a client_id and client_secret. Save the secret — it's shown only once.

2

Get an access token

Exchange your credentials for a Bearer token:

curl
curl -X POST https://alkoholiks-api.vercel.app/api/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET"
Response
{
  "access_token": "alk_at_abc123...",
  "token_type": "Bearer",
  "expires_in": 3600
}

Tokens expire after 1 hour. Request a new one when needed.

3

Make your first API call

Search for products across all stores:

curl
curl "https://alkoholiks-api.vercel.app/api/v1/products/search?q=monster" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
{
  "data": [
    {
      "name": "Monster Energy Green 500ml",
      "store": "selver",
      "regularPrice": 1.89,
      "drinkType": "energiajook",
      "onSale": false
    }
  ],
  "meta": {
    "total": 61,
    "limit": 50,
    "offset": 0,
    "request_id": "req_a1b2c3d4"
  }
}
4

Use the TypeScript SDK (optional)

Install
npm install alkoholiks-sdk
TypeScript
import { AlkoholiksAPI } from "alkoholiks-sdk";

const api = new AlkoholiksAPI({
  clientId: "alk_cid_...",
  clientSecret: "alk_sec_...",
});

// Auto-handles token lifecycle
const results = await api.searchProducts("saku");
console.log(results.data); // Product[]

The SDK auto-manages tokens and retries on rate limits.

5

Handle errors

Every error returns a consistent JSON envelope:

Error response
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "You have exceeded 100 requests per hour",
    "retry_after": 847,
    "docs_url": "https://alkoholiks-api.vercel.app/docs/errors#RATE_LIMIT_EXCEEDED"
  }
}

See the full Error Reference for all error codes.

Rate Limits

Every consumer gets 100 requests per hour. Rate limit info is included in every response:

Response headers
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 94
X-RateLimit-Reset: 1774173600
X-Request-Id: req_a1b2c3d4