Skip to content

GET /api/faq/category/:id

Public endpoint to search FAQ entries within a specific category.

Base URL

  • Production: https://faq.dlapolakow.app

Request

  • Method: GET
  • Path: /api/faq/category/:id

Path params

  • id (number, required): category id.

Query params

  • q (string, optional): search phrase.
  • lang (string, optional): pl,en,nl. Default is pl.

Request example

bash
curl -X GET "https://faq.dlapolakow.app/api/faq/category/1?q=tax&lang=en"

Response 200

json
{
  "ok": true,
  "category": {
    "id": 1,
    "name": {
      "pl": "Formalnosci",
      "en": "Formalities",
      "nl": "Formaliteiten"
    }
  },
  "faqs": [
    {
      "id": "8b96f5ef2b2f4be8a77d6c6f3a8de9f1",
      "slug": "taxes-in-the-netherlands",
      "seo_title": "Taxes in the Netherlands",
      "seo_description": "Most important tax information",
      "category": {
        "id": 1,
        "name": {
          "pl": "Formalnosci",
          "en": "Formalities",
          "nl": "Formaliteiten"
        }
      }
    }
  ],
  "total": 1,
  "q": "tax"
}

Endpoint behavior

  • Returns only published entries from the selected category.
  • If q is empty, returns up to 50 entries from that category.
  • If q is provided, applies the same search logic as the main FAQ search endpoint.

Error codes

  • 400 invalid category id:
json
{
  "ok": false,
  "error": "Invalid category id"
}
  • 404 category not found:
json
{
  "ok": false,
  "error": "Category not found"
}
  • 500 server error:
json
{
  "ok": false,
  "error": "Unknown error"
}