Medio Web API
Medio Web API — integration overview
This page shows which API endpoint feeds which section, with which parameter, from which fields, and how it is cached.
- 7 endpoints
- Data source: Live API
Data flow
All data arrives on the server through the lib/medio-api module; the token never reaches the browser.
When both MEDIO_API_BASE and MEDIO_API_TOKEN are set, the module calls the live API (Bearer token, 8 s timeout); otherwise it serves the mock fixtures.
Live responses are kept in the Next.js data cache for 300 seconds; on an error the module falls back to the mock data and logs it.
HTML fields are sanitized on the server (sanitize-html, inline styles removed), and the booking embed only loads from an allowed host.
Endpoints and where they are used
| Endpoint | Parameter | Where it appears | Fields used | Cache |
|---|---|---|---|---|
GET /institutionslib/medio-api · getInstitutions() | — | Locations on the home and contact pages, the location filter of the price list, MedicalClinic JSON-LD. |
| 300 s |
GET /specializationslib/medio-api · getSpecializations(intezmenyId?) | intezmeny_id | Specialty grid, specialty pages, filter chips on the doctor list, statistics. |
| 300 s |
GET /doctorslib/medio-api · getDoctorsBySpecialization(szakteruletId) | szakterulet_id | Doctor list (merged across specialties, de-duplicated by id), featured doctors, doctor profile, Physician JSON-LD. |
| 300 s |
GET /doctorlib/medio-api · getDoctorPricelist(doctorId) | doctor_id | The doctor's own price list on the profile. |
| 300 s |
GET /qualification-priceslib/medio-api · getQualificationPrices(qualificationId) | qualification_id | The price list of a specialty page, grouped by parent service. |
| 300 s |
GET /pricelistlib/medio-api · getPricelist() | — | The full price list, the number of services, and the source of English names for the other endpoints. |
| 300 s |
GET /searchlib/medio-api · searchApi(q) | q | The search page, grouped by result type. |
| 300 s |
API gaps and how they are handled
- Specializations have no id field: the qualificationId comes from the query string of the link field.
- Doctors have no id field: the doctorId comes from the iframe URL in naptar_script (doctorId parameter).
- The relation between szakterulet_id and qualificationId is not documented: one function maps them (lib/medio-api/ids.ts) and MEDIO_QUALIFICATION_MAP can override it.
- English (*_eng) fields exist only in /pricelist; English specialty and service names are matched from there for the other endpoints.
- The API sends its text in the clinic's own language (Romanian here) and English only in /pricelist: the other languages come from a translation table on the site, with a note where a text has none.
- Prices arrive as strings (min_ar, max_ar) without a currency: the currency is configured per institution (MEDIO_CURRENCY_MAP).
- Several fields contain HTML with inline styles (specializaciok, intezmenyi_hatter, tagsagok, possibly bemutatkozas): the server sanitizes them.
- The intezmeny_id parameter of /specializations is required in the schema but optional in the description; the demo calls it without the parameter.
- Of the /search result types only “qualification” is documented; other types get an internal link when an id can be read from the value URL.
Sample responses from the current data source
The first item of every endpoint, as lib/medio-api returns it.
GET /institutions1
{
"intezmeny_id": 132,
"intezmeny_nev": "Medio Demo Clinic S.R.L",
"varos": ""
}GET /specializations?intezmeny_id=13218
{
"intezmeny_id": 132,
"intezmeny_nev": "Medio Demo Clinic S.R.L",
"szakterulet": "Acupunctură",
"tipus_id": 2,
"tipus": "Felnőtt",
"link": "https://mediodemoclinicsrl.medflow.ro/services/10000087?qualificationId=10000087"
}GET /doctors?szakterulet_id=100000871
{
"intezmeny_id": 132,
"nev": "Prof. Mihai Stan",
"profilkep": "/doctors/102363.jpg",
"szakteruletek": "Acupunctură, Competenţă imunitară, ONCOLOGIE MEDICALĂ",
"bemutatkozas": "Atenție la detalii și utilizarea celor mai noi tehnologii medicale.",
"beszelt_nyelvek": "",
"specializaciok": "[HTML] Chirurgie minim invazivă",
"tanulmanyok": "[HTML] UMF 'Carol Davila', București",
"intezmenyi_hatter": "[HTML] Rețeaua Privată de Sănătate",
"tagsagok": "[HTML] Colegiul Medicilor din România, Societatea Română de Acupunctură",
"naptar_script": "[HTML iframe + script] https://mediodemoclinicsrl.medflow.ro/doctors/102363?doctorId=102363&qualificationId…",
"naptar_script_2": "[HTML iframe + script] https://mediodemoclinicsrl.medflow.ro/doctors/102363?doctorId=102363&qualificationId…",
"sorrend": 6
}GET /doctor?doctor_id=1023606
{
"intezmeny_id": 132,
"szakterulet_id": 10000083,
"szakterulet": "Competenţă imunitară",
"szulo_szolgaltatas_id": 10000083,
"szulo_szolgaltatas": "Competenţă imunitară",
"szolgaltatas": "Consultație imunologie",
"min_ar": "240",
"max_ar": "300",
"tipus_id": 2,
"tipus": "Felnőtt",
"link": "https://mediodemoclinicsrl.medflow.ro/services/10000083?serviceId=10000996,10001067,10001106,10001132,10001…",
"info_text": "Serviciu medical de consultație imunologie oferit în cadrul departamentului de Competenţă imunitară."
}GET /qualification-prices?qualification_id=100000873
{
"intezmeny_id": 132,
"szakterulet_id": 10000087,
"szakterulet": "Acupunctură",
"szakterulet_eng": "",
"szulo_szolgaltatas_id": 10000087,
"szulo_szolgaltatas": "Acupunctură",
"szolgaltatas": "Evaluare energetică și diagnostic acupunctură",
"szolgaltatas_eng": "",
"min_ar": "220",
"max_ar": "220",
"tipus_id": 2,
"tipus": "Felnőtt",
"link": "https://mediodemoclinicsrl.medflow.ro/services/10000087?serviceId=10001248",
"info_text": "Serviciu medical de evaluare energetică și diagnostic acupunctură oferit în cadrul departamentului de Acupu…",
"info_text_eng": ""
}GET /pricelist55
{
"intezmeny_id": 132,
"szakterulet_id": 10000087,
"szakterulet": "Acupunctură",
"szakterulet_eng": "",
"szulo_szolgaltatas_id": 10000087,
"szulo_szolgaltatas": "Acupunctură",
"szolgaltatas": "Evaluare energetică și diagnostic acupunctură",
"szolgaltatas_eng": "",
"min_ar": "220",
"max_ar": "220",
"tipus_id": 2,
"tipus": "Felnőtt",
"link": "https://mediodemoclinicsrl.medflow.ro/services/10000087?serviceId=10001248",
"info_text": "Serviciu medical de evaluare energetică și diagnostic acupunctură oferit în cadrul departamentului de Acupu…",
"info_text_eng": ""
}GET /search?q=kardio0
null