# Get the site

`GET https://app.pozyskajpacjenta.pl/api/v1/site` · operationId `getSite` · since 1.4.0 · tag Content

The same `site` object GET /content returns next to a page: name, domain, menu, theme and the clinic profile (contact, address, hours, NFZ, payments, logos). Use it for layouts, footers, JSON-LD and metadata without fetching a page. Responses are private to the key: `Cache-Control: private, max-age=60`, so cache them on your side for up to a minute.

## Request

Authorization: `Bearer <the clinic's key>`.

### cURL

```bash
curl "https://app.pozyskajpacjenta.pl/api/v1/site" \
  -H "Authorization: Bearer $PP_API_KEY"
```

### TypeScript

```ts
import { PozyskajPacjentaClient } from "@pozyskajpacjenta/sdk";

const client = new PozyskajPacjentaClient({
  apiKey: process.env.PP_API_KEY ?? "",
  baseUrl: "https://app.pozyskajpacjenta.pl",
});

const { site } = await client.getSite();
```

### PHP

```php
<?php
$response = wp_remote_get(
    'https://app.pozyskajpacjenta.pl/api/v1/site',
    array(
        'headers' => array( 'Authorization' => 'Bearer ' . getenv( 'PP_API_KEY' ) ),
        'timeout' => 10,
    )
);
if ( is_wp_error( $response ) ) {
    error_log( $response->get_error_message() );
    return;
}
$status = wp_remote_retrieve_response_code( $response );
$data   = json_decode( wp_remote_retrieve_body( $response ), true );
```

## Response

### 200: The site.

- `site` (`Site`, required): The clinic's site.
  - `name` (`string`, required): Name of the clinic as shown on the site.
  - `primaryDomain` (`string | null`): The site's main domain; null before a domain is connected.
  - `menu` (`MenuItem[]`, required): The main menu, in order.
    - `label` (`string`, required): Text of the menu item.
    - `path` (`string`, required): Path on the clinic's site, e.g. /zabiegi.
  - `theme` (`ThemeTokens`, required): Theme tokens of the site.
  - `profile` (`SiteProfile | null`, required): The clinic profile; null until the clinic fills it in.
    - `legalName` (`string`): Registered name of the entity that runs the clinic.
    - `phone` (`string`): Phone number for display, e.g. +48 22 100 20 30. For a tel: link keep the digits and the +.
    - `email` (`string (email)`): The clinic's contact e-mail.
    - `address` (`SiteAddress`): The clinic's address.
      - `street` (`string`, required): Street and number.
      - `postalCode` (`string`, required): Postal code, 00-000.
      - `city` (`string`, required): City.
      - `district` (`string`): District, e.g. Mokotów.
      - `accessNote` (`string`): How to get in: entrance, floor, parking, lift.
    - `geo` (`object`): Map point of the clinic.
      - `lat` (`number`, required): Latitude.
      - `lng` (`number`, required): Longitude.
    - `openingHours` (`OpeningHours`): Opening hours per weekday.
      - `mon` (`OpeningInterval[]`): Monday's intervals.
        - `opens` (`string`, required): Opening time, HH:MM.
        - `closes` (`string`, required): Closing time, HH:MM, later than `opens`.
      - `tue` (`OpeningInterval[]`): Tuesday's intervals.
        - fields as in `OpeningInterval` above
      - `wed` (`OpeningInterval[]`): Wednesday's intervals.
        - fields as in `OpeningInterval` above
      - `thu` (`OpeningInterval[]`): Thursday's intervals.
        - fields as in `OpeningInterval` above
      - `fri` (`OpeningInterval[]`): Friday's intervals.
        - fields as in `OpeningInterval` above
      - `sat` (`OpeningInterval[]`): Saturday's intervals.
        - fields as in `OpeningInterval` above
      - `sun` (`OpeningInterval[]`): Sunday's intervals.
        - fields as in `OpeningInterval` above
    - `openingHoursNote` (`string`): Note shown next to the hours, e.g. until when the phone is answered.
    - `nfz` (`object`): Contract with the National Health Fund (NFZ).
      - `contract` (`boolean`, required): true when the clinic has an NFZ contract.
      - `note` (`string`): Note about the NFZ contract, e.g. which services it covers.
    - `payments` (`object`): Accepted payment methods.
      - `methods` (`string[]`, required): Payment methods as the clinic names them, e.g. gotówka, karta, BLIK.
      - `note` (`string`): Note about payments, e.g. instalments.
    - `socials` (`object[]`): Links to the clinic's profiles elsewhere.
      - `network` (`string`, required): The network. One of `facebook`, `instagram`, `youtube`, `tiktok`, `linkedin`, `x`, `google`, `znanylekarz`, `other`.
      - `url` (`string`, required): Profile address (https://).
    - `logo` (`MediaRef | null`): Logo; null when the file was removed from the media library.
      - `url` (`string`, required): Absolute address of the file.
      - `focalX` (`integer | null`): Horizontal focal point in percent (0 to 100) to keep when cropping, e.g. as object-position.
      - `focalY` (`integer | null`): Vertical focal point in percent (0 to 100).
      - `alt` (`string | null`): Alternative text; null when the clinic left it empty.
      - `width` (`integer`): Width of the original in px (library files, when known), for width/height attributes without layout shift.
      - `height` (`integer`): Height of the original in px.
      - `aiGenerated` (`boolean`): The image was generated by AI: label it next to the image (e.g. in a caption).
      - `caption` (`string`): Caption to show under the image.
    - `logoInverse` (`MediaRef | null`): Logo for dark backgrounds.
      - fields as in `MediaRef` above
    - `favicon` (`MediaRef | null`): Favicon file.
      - fields as in `MediaRef` above
    - `defaultOgImage` (`MediaRef | null`): og:image for pages that have none of their own.
      - fields as in `MediaRef` above
    - `registry` (`object`): Registry numbers. Show only the ones that are set.
      - `rpwdl` (`string`): Number in the register of medical entities (RPWDL).
      - `nip` (`string`): Tax identification number (NIP).
      - `regon` (`string`): Statistical number (REGON).
      - `krs` (`string`): Court register number (KRS).
    - `privacy` (`object`, since 1.7.0): Data for the privacy policy and the information clause. The controller is `legalName` with the address and the `registry` numbers. Full policy text: GET /privacy.
      - `contactEmail` (`string (email)`, since 1.7.0): E-mail for personal-data requests; the clinic's `email` when unset.
      - `registeredOffice` (`string`, since 1.7.0): The controller's registered office, when it differs from the clinic address.
      - `dpoName` (`string`, since 1.7.0): Data protection officer, when one is appointed.
      - `dpoEmail` (`string (email)`, since 1.7.0): The data protection officer's e-mail.
    - `reviewsPolicy` (`string`): How the clinic collects and checks the reviews it shows on its site.
    - `demoNotice` (`string`): A notice for every page (e.g. a demo site). Show it when present.
  - `noindex` (`boolean`, since 1.5.0): true: the site stays out of search engines (a demo, or before launch). Add meta robots noindex to every page (ideally also the header X-Robots-Tag: noindex) and publish no sitemap. Keep robots.txt open (`Allow: /`, no Sitemap line): a crawler has to fetch the pages to see the noindex and drop URLs it indexed before.

Example (The site with its clinic profile):

```json
{
  "site": {
    "name": "Klinika Wzorcowa",
    "primaryDomain": "wzorcowa.pozyskajpacjenta.pl",
    "menu": [
      {
        "label": "Strona główna",
        "path": "/"
      },
      {
        "label": "Zabiegi",
        "path": "/zabiegi"
      },
      {
        "label": "Zespół",
        "path": "/zespol"
      },
      {
        "label": "Rezerwacja",
        "path": "/rezerwacja"
      }
    ],
    "theme": {
      "version": 1,
      "colors": {
        "background": "#faf7f1",
        "foreground": "#211d18",
        "surface": "#fffdf9",
        "surface2": "#f3ede1",
        "muted": "#f1eadb",
        "mutedForeground": "#655c4e",
        "primary": "#7a5c2e",
        "primaryForeground": "#fffdf9",
        "accent": "#2c2a25",
        "accentForeground": "#f5efe2",
        "border": "#e3dac7"
      },
      "colorsDark": {
        "background": "#171310",
        "foreground": "#f2ecdf",
        "surface": "#201b15",
        "surface2": "#2a241b",
        "muted": "#242017",
        "mutedForeground": "#b5aa93",
        "primary": "#d3ab63",
        "primaryForeground": "#231b0e",
        "accent": "#ece0c6",
        "accentForeground": "#1c1712",
        "border": "#3a3326"
      },
      "radius": "0.375rem",
      "radiusPill": "9999px",
      "fontSans": "\"Inter\", \"Inter Fallback\", system-ui, sans-serif",
      "fontHeading": "\"Fraunces\", \"Fraunces Fallback\", Georgia, serif",
      "type": {
        "baseMinPx": 16,
        "baseMaxPx": 17.5,
        "ratioMin": 1.18,
        "ratioMax": 1.3,
        "headingWeight": 560,
        "bodyWeight": 400,
        "headingLineHeight": 1.04,
        "bodyLineHeight": 1.62,
        "headingTracking": -0.012
      },
      "rhythm": {
        "sectionYMinRem": 5,
        "sectionYMaxRem": 10,
        "container": "76rem"
      },
      "elevation": {
        "shadowColor": "#2a2114",
        "strength": 0.16
      },
      "motion": {
        "durationFastMs": 180,
        "durationBaseMs": 340,
        "durationSlowMs": 750,
        "easeOut": "cubic-bezier(0.22, 1, 0.36, 1)",
        "easeSpring": "cubic-bezier(0.32, 1.2, 0.6, 1)"
      },
      "imagery": {
        "overlayColor": "#1a1208",
        "overlayOpacity": 0.5,
        "imageRadius": "0.375rem"
      }
    },
    "profile": {
      "legalName": "Klinika Wzorcowa sp. z o.o.",
      "phone": "+48 22 100 20 30",
      "email": "recepcja@klinika-wzorcowa.example",
      "address": {
        "street": "ul. Przykładowa 12",
        "postalCode": "00-950",
        "city": "Warszawa",
        "district": "Mokotów",
        "accessNote": "Wejście od podwórza, parter, winda."
      },
      "geo": {
        "lat": 52.1935,
        "lng": 21.0346
      },
      "openingHours": {
        "mon": [
          {
            "opens": "08:00",
            "closes": "20:00"
          }
        ],
        "tue": [
          {
            "opens": "08:00",
            "closes": "20:00"
          }
        ],
        "wed": [
          {
            "opens": "08:00",
            "closes": "20:00"
          }
        ],
        "thu": [
          {
            "opens": "08:00",
            "closes": "20:00"
          }
        ],
        "fri": [
          {
            "opens": "08:00",
            "closes": "16:00"
          }
        ],
        "sat": [
          {
            "opens": "09:00",
            "closes": "14:00"
          }
        ]
      },
      "openingHoursNote": "Rejestracja telefoniczna do 19:00.",
      "nfz": {
        "contract": false
      },
      "payments": {
        "methods": [
          "gotówka",
          "karta",
          "BLIK"
        ]
      }
    },
    "noindex": false
  }
}
```

## Errors

| Status | code | When |
| --- | --- | --- |
| 401 |  | No Authorization header |
| 401 |  | Unknown or rotated key |
| 404 |  | The clinic's site is not published |
| 429 |  | Over 120 requests in this minute |

401 (No Authorization header):

```json
{
  "error": "missing Authorization: Bearer <klucz z panelu Ustawienia>"
}
```

401 (Unknown or rotated key):

```json
{
  "error": "invalid key"
}
```

404 (The clinic's site is not published):

```json
{
  "error": "site not published"
}
```

429 (Over 120 requests in this minute):

```json
{
  "error": "przekroczono limit 120 zapytań/min"
}
```

## Rate limit

- 120 requests per minute per key, shared by every endpoint.

## SDK method

`client.getSite(): Promise<SiteInfo>`
