Get Hospital Information
curl --request POST \
--url https://api.aisa.one/apis/v1/api-ninjas/get-hospitals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"city": "New York",
"county": "New York County",
"limit": 50,
"max_latitude": 0,
"max_longitude": 0,
"min_latitude": 0,
"min_longitude": 0,
"name": "General Hospital",
"offset": 1,
"state": "NY",
"zipcode": "10001"
}
'import requests
url = "https://api.aisa.one/apis/v1/api-ninjas/get-hospitals"
payload = {
"city": "New York",
"county": "New York County",
"limit": 50,
"max_latitude": 0,
"max_longitude": 0,
"min_latitude": 0,
"min_longitude": 0,
"name": "General Hospital",
"offset": 1,
"state": "NY",
"zipcode": "10001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
city: 'New York',
county: 'New York County',
limit: 50,
max_latitude: 0,
max_longitude: 0,
min_latitude: 0,
min_longitude: 0,
name: 'General Hospital',
offset: 1,
state: 'NY',
zipcode: '10001'
})
};
fetch('https://api.aisa.one/apis/v1/api-ninjas/get-hospitals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/api-ninjas/get-hospitals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'city' => 'New York',
'county' => 'New York County',
'limit' => 50,
'max_latitude' => 0,
'max_longitude' => 0,
'min_latitude' => 0,
'min_longitude' => 0,
'name' => 'General Hospital',
'offset' => 1,
'state' => 'NY',
'zipcode' => '10001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/api-ninjas/get-hospitals"
payload := strings.NewReader("{\n \"city\": \"New York\",\n \"county\": \"New York County\",\n \"limit\": 50,\n \"max_latitude\": 0,\n \"max_longitude\": 0,\n \"min_latitude\": 0,\n \"min_longitude\": 0,\n \"name\": \"General Hospital\",\n \"offset\": 1,\n \"state\": \"NY\",\n \"zipcode\": \"10001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/api-ninjas/get-hospitals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"city\": \"New York\",\n \"county\": \"New York County\",\n \"limit\": 50,\n \"max_latitude\": 0,\n \"max_longitude\": 0,\n \"min_latitude\": 0,\n \"min_longitude\": 0,\n \"name\": \"General Hospital\",\n \"offset\": 1,\n \"state\": \"NY\",\n \"zipcode\": \"10001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/api-ninjas/get-hospitals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"city\": \"New York\",\n \"county\": \"New York County\",\n \"limit\": 50,\n \"max_latitude\": 0,\n \"max_longitude\": 0,\n \"min_latitude\": 0,\n \"min_longitude\": 0,\n \"name\": \"General Hospital\",\n \"offset\": 1,\n \"state\": \"NY\",\n \"zipcode\": \"10001\"\n}"
response = http.request(request)
puts response.read_body{
"details": [
{
"address": "<string>",
"bedcount": 123,
"care_type": "<string>",
"city": "<string>",
"county": "<string>",
"fips_code": "<string>",
"latitude": 123,
"location_area_code": "<string>",
"longitude": 123,
"name": "<string>",
"ownership": "<string>",
"phone_number": "<string>",
"state": "<string>",
"timezone": "<string>",
"website": "<string>",
"zipcode": "<string>"
}
]
}API Ninjas
Get Hospital Information
Get Hospital Information
POST
https://api.aisa.one
/
apis
/
v1
/
api-ninjas
/
get-hospitals
Get Hospital Information
curl --request POST \
--url https://api.aisa.one/apis/v1/api-ninjas/get-hospitals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"city": "New York",
"county": "New York County",
"limit": 50,
"max_latitude": 0,
"max_longitude": 0,
"min_latitude": 0,
"min_longitude": 0,
"name": "General Hospital",
"offset": 1,
"state": "NY",
"zipcode": "10001"
}
'import requests
url = "https://api.aisa.one/apis/v1/api-ninjas/get-hospitals"
payload = {
"city": "New York",
"county": "New York County",
"limit": 50,
"max_latitude": 0,
"max_longitude": 0,
"min_latitude": 0,
"min_longitude": 0,
"name": "General Hospital",
"offset": 1,
"state": "NY",
"zipcode": "10001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
city: 'New York',
county: 'New York County',
limit: 50,
max_latitude: 0,
max_longitude: 0,
min_latitude: 0,
min_longitude: 0,
name: 'General Hospital',
offset: 1,
state: 'NY',
zipcode: '10001'
})
};
fetch('https://api.aisa.one/apis/v1/api-ninjas/get-hospitals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/api-ninjas/get-hospitals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'city' => 'New York',
'county' => 'New York County',
'limit' => 50,
'max_latitude' => 0,
'max_longitude' => 0,
'min_latitude' => 0,
'min_longitude' => 0,
'name' => 'General Hospital',
'offset' => 1,
'state' => 'NY',
'zipcode' => '10001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/api-ninjas/get-hospitals"
payload := strings.NewReader("{\n \"city\": \"New York\",\n \"county\": \"New York County\",\n \"limit\": 50,\n \"max_latitude\": 0,\n \"max_longitude\": 0,\n \"min_latitude\": 0,\n \"min_longitude\": 0,\n \"name\": \"General Hospital\",\n \"offset\": 1,\n \"state\": \"NY\",\n \"zipcode\": \"10001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/api-ninjas/get-hospitals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"city\": \"New York\",\n \"county\": \"New York County\",\n \"limit\": 50,\n \"max_latitude\": 0,\n \"max_longitude\": 0,\n \"min_latitude\": 0,\n \"min_longitude\": 0,\n \"name\": \"General Hospital\",\n \"offset\": 1,\n \"state\": \"NY\",\n \"zipcode\": \"10001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/api-ninjas/get-hospitals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"city\": \"New York\",\n \"county\": \"New York County\",\n \"limit\": 50,\n \"max_latitude\": 0,\n \"max_longitude\": 0,\n \"min_latitude\": 0,\n \"min_longitude\": 0,\n \"name\": \"General Hospital\",\n \"offset\": 1,\n \"state\": \"NY\",\n \"zipcode\": \"10001\"\n}"
response = http.request(request)
puts response.read_body{
"details": [
{
"address": "<string>",
"bedcount": 123,
"care_type": "<string>",
"city": "<string>",
"county": "<string>",
"fips_code": "<string>",
"latitude": 123,
"location_area_code": "<string>",
"longitude": 123,
"name": "<string>",
"ownership": "<string>",
"phone_number": "<string>",
"state": "<string>",
"timezone": "<string>",
"website": "<string>",
"zipcode": "<string>"
}
]
}Request contract
- Method and path: POST /apis/v1/api-ninjas/get-hospitals
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/api-ninjas/get-hospitals
{
"operationId": "api-ninjas.get-hospitals",
"method": "POST",
"path": "/apis/v1/api-ninjas/get-hospitals",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"city": {
"description": "City where the hospital is located (e.g., 'New York', 'Los Angeles').",
"examples": [
"New York",
"Los Angeles"
],
"type": "string"
},
"county": {
"description": "County where the hospital is located (e.g., 'New York County', 'Los Angeles County').",
"examples": [
"New York County",
"Los Angeles County"
],
"type": "string"
},
"limit": {
"description": "Number of results to return per request (maximum 100, free users limited to 5).",
"maximum": 100,
"minimum": 1,
"type": "integer"
},
"max_latitude": {
"description": "Maximum latitude coordinate for geographic filtering (range: -90 to 90).",
"maximum": 90,
"minimum": -90,
"type": "number"
},
"max_longitude": {
"description": "Maximum longitude coordinate, applied locally within the requested provider page (range: -180 to 180). Requires a name or location filter; coordinate-only search is not supported.",
"maximum": 180,
"minimum": -180,
"type": "number"
},
"min_latitude": {
"description": "Minimum latitude coordinate for geographic filtering (range: -90 to 90).",
"maximum": 90,
"minimum": -90,
"type": "number"
},
"min_longitude": {
"description": "Minimum longitude coordinate, applied locally within the requested provider page (range: -180 to 180). Requires a name or location filter; coordinate-only search is not supported.",
"maximum": 180,
"minimum": -180,
"type": "number"
},
"name": {
"description": "Hospital name to search for (e.g., 'General Hospital', 'Memorial'). Partial matches are supported.",
"examples": [
"General Hospital",
"Memorial"
],
"type": "string"
},
"offset": {
"description": "Provider-row offset to skip the first N results. Geographic bounds are enforced within each provider page; advance offset to inspect further pages.",
"minimum": 0,
"type": "integer"
},
"state": {
"description": "State where the hospital is located (e.g., 'NY', 'CA', 'Texas').",
"examples": [
"NY",
"CA",
"Texas"
],
"type": "string"
},
"zipcode": {
"description": "Hospital ZIP code (e.g., '10001', '90001').",
"examples": [
"10001",
"90001"
],
"type": "string"
}
},
"type": "object"
}
}
},
"required": false
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Usage-based pricing. Default request estimate: $0.00089 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.Authorizations
Body
application/json