Skip to main content
GET
/
doctor
/
search
Search Doctors
curl --request GET \
  --url https://api.example.com/doctor/search
{
  "[]": [
    {
      "crm": "<string>",
      "email": "<string>",
      "password": "<string>",
      "name": "<string>",
      "specialty": "<string>",
      "telephone": "<string>",
      "consultationValue": 123
    }
  ],
  "400 Bad Request": {},
  "200 OK (Empty Array)": {}
}
Search for doctors using various criteria. Only one query parameter should be provided at a time.

Query Parameters

crm
string
Search by CRM (Medical Registration) number.
name
string
Search by doctor’s name (partial match).
specialty
string
Search by medical specialty.
email
string
Search by email address.

Response

Returns an array of matching doctor objects.
[]
array
Array of Doctor objects matching the search criteria.
crm
string
Doctor’s CRM number.
email
string
Doctor’s email address.
password
string
Doctor’s password.
name
string
Doctor’s full name.
specialty
string
Doctor’s medical specialty.
telephone
string
Doctor’s telephone number.
consultationValue
number
Consultation price.

Example Requests

Search by CRM

curl -X GET "http://localhost:8080/doctor/search?crm=123456789"

Search by Name

curl -X GET "http://localhost:8080/doctor/search?name=Silva"

Search by Specialty

curl -X GET "http://localhost:8080/doctor/search?specialty=Cardiology"

Search by Email

curl -X GET "http://localhost:8080/doctor/[email protected]"

Example Response

[
  {
    "crm": "123456789",
    "email": "[email protected]",
    "password": "securePassword123",
    "name": "Dr. João Silva",
    "specialty": "Cardiology",
    "telephone": "+5534999887766",
    "consultationValue": 250.00
  }
]

Error Responses

400 Bad Request
error
No search parameter provided. At least one query parameter (crm, name, specialty, or email) is required.
200 OK (Empty Array)
success
No doctors found matching the search criteria. Returns an empty array [].

Build docs developers (and LLMs) love