AIWA logo AIWA

API DOCS

API
Documentation

Public JSON APIs for blog and portfolio data. This page explains supported parameters, response format and what exactly is returned to integrations.

Common Rules

The JSON API is protected by a secret key and is intended for external projects, mobile apps and internal integrations.

Format

JSON, UTF-8

Auth

Secret key required

Methods

GET, OPTIONS

CORS

Enabled: Access-Control-Allow-Origin: *

Send the key either via `X-API-Key` or `Authorization: Bearer <key>`.

Every successful response includes `ok`.

`lang` supports `ru`, `en`, `zh`. Unsupported values fall back to `ru`.

`limit` is clamped between `1` and `100`.

`offset` is used for list pagination.

`OPTIONS` returns `204`, unsupported methods return `405`.

Authentication

API `GET` requests without a valid key return `401 Unauthorized`. `OPTIONS` stays public for CORS preflight requests.

Option 1: X-API-Key

X-API-Key: <your-secret-key>

Option 2: Authorization Bearer

Authorization: Bearer <your-secret-key>

Blog API

Returns a list of blog posts or a single post by `slug`.

Endpoint

https://www.aiwa.company/api/v1/blog/

Parameters

Field Type Required Description
lang string No ru, en, zh. Defaults to ru.
slug string No Return one post by slug.
limit integer No Number of posts in list mode. Default 20, max 100.
offset integer No List offset for pagination.

Example Requests

curl -H "X-API-Key: <your-secret-key>" "https://www.aiwa.company/api/v1/blog/?lang=ru&limit=5"
curl -H "Authorization: Bearer <your-secret-key>" "https://www.aiwa.company/api/v1/blog/?lang=ru&slug=how-to-build-fast-websites"

Response

Field Type Description
ok boolean Success flag.
resource string Resource type: `blog` or `portfolio`.
lang string Localization language used in the response.
count integer Number of items returned in `items`.
items array Array of resource objects.

Portfolio API

Returns a list of portfolio cases or a single case by `slug`.

Portfolio items are always returned in `sort_order ASC`. This is the same order shown on the public portfolio page.

Endpoint

https://www.aiwa.company/api/v1/portfolio/

Parameters

Field Type Required Description
lang string No ru, en, zh. Defaults to ru.
slug string No Return one case by slug.
category string No Return only cases from the specified category.
limit integer No Number of cases in list mode. Default 20, max 100.
offset integer No List offset for pagination.

Example Requests

curl -H "X-API-Key: <your-secret-key>" "https://www.aiwa.company/api/v1/portfolio/?lang=ru&limit=6"
curl -H "X-API-Key: <your-secret-key>" "https://www.aiwa.company/api/v1/portfolio/?lang=ru&category=Web&limit=6"
curl -H "Authorization: Bearer <your-secret-key>" "https://www.aiwa.company/api/v1/portfolio/?lang=ru&slug=aiwa-corporate-website"

Response

Field Type Description
ok boolean Success flag.
resource string Resource type: `blog` or `portfolio`.
lang string Localization language used in the response.
count integer Number of items returned in `items`.
items array Array of resource objects.
total integer Total number of cases after filtering and before slicing.
limit integer|null Requested limit. `null` for slug-based requests.
offset integer|null Requested offset. `null` for slug-based requests.
filters object Applied filters: `slug`, `category`.
order object Sorting info. Current API uses ascending `sort_order`.

Main Portfolio Item Fields

Field Type Description
id string Case ID.
slug string Unique case slug.
sort_order integer Portfolio position. Lower values appear earlier.
category string Case category.
website_url string Project website URL when available.
cover_image_url string Case cover image URL.
tech_stack string Technology stack.
title string Localized title.
summary string Short summary.
content_html string HTML content.
date string Localized creation date.
seo_title string SEO title.
seo_description string SEO description.
seo_keywords string SEO keywords.

JSON

{
  "ok": true,
  "resource": "portfolio",
  "lang": "ru",
  "count": 2,
  "total": 14,
  "limit": 2,
  "offset": 0,
  "filters": {
    "slug": null,
    "category": "Web"
  },
  "order": {
    "field": "sort_order",
    "direction": "asc",
    "note": "Items are returned in the same order as the public portfolio page."
  },
  "items": [
    {
      "id": "17",
      "slug": "aiwa-corporate-website",
      "sort_order": 1,
      "category": "Web",
      "title": "AIWA Corporate Website"
    },
    {
      "id": "21",
      "slug": "studio-redesign",
      "sort_order": 2,
      "category": "Web",
      "title": "Studio Redesign"
    }
  ]
}

Status Codes

Field Description
401 Secret API key is missing or invalid.
200 Successful JSON response.
204 Empty response for `OPTIONS`.
405 Method not allowed.