# Censys API reference

> The Censys Platform API returns Censys's internet scan data: hosts (by IP address) with their services, software, labels, location, autonomous system, DNS names and WHOIS; web properties (a hostname and port); and TLS certificates (by SHA-256 fingerprint). It also runs searches and aggregate…

Source: https://osinttools.io/apis/censys/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

Compiled by OSINTtools.io editors from the vendor's docs, updated Nov 29, 2026. Listing: https://osinttools.io/tools/censys/

- Base URL: https://api.platform.censys.io
- Authentication: Bearer token in the `Authorization` header. A Personal Access Token from your Censys account settings. Organization accounts add organization_id.
- Free tier: yes
- Pricing: Credits
- Rate limits: Concurrent requests per organization: 1 on Free and Starter, 25 on Search and Core (over it: 429). 25 requests per second on all endpoints (over it: 503).
- Vendor docs: https://docs.censys.com/reference/get-started
- Python SDK: censys-platform, https://github.com/censys/censys-sdk-python
- Go SDK: censys-sdk-go, https://github.com/censys/censys-sdk-go
- TypeScript SDK: censys-sdk-typescript, https://github.com/censys/censys-sdk-typescript

## Overview

The Censys Platform API returns Censys's internet scan data: hosts (by IP address) with their services, software, labels, location, autonomous system, DNS names and WHOIS; web properties (a hostname and port); and TLS certificates (by SHA-256 fingerprint). It also runs searches and aggregate reports written in the Censys Query Language (CenQL), and shows a host's event history.

An investigator uses it to see what an IP address exposes and how that changed over time, to read a certificate, and to find other hosts, web properties or certificates that share an indicator such as a banner, JARM or favicon hash.

Calls go to `https://api.platform.censys.io` with a Personal Access Token in `Authorization: Bearer …`. Accounts in an organization also send the organization ID as the `organization_id` query parameter (or the `X-Organization-ID` header); without it the user's free wallet is used where applicable. Responses are JSON with the data under `result`.

API calls consume credits: 1 per lookup, 1 per search page and 1 per aggregate report. Free users receive 100 credits a month and can only call host, web property and certificate lookups. Calls made with Try It on Censys's own docs also deduct credits.

## Errors

| Status | Meaning |
| --- | --- |
| 400 | Bad request |
| 401 | The request does not contain a valid Authorization token |
| 403 | The user does not have permission to access this data |
| 404 | Not found |
| 422 | Unprocessable entity: invalid input |
| 429 | Concurrency limit exceeded |
| 500 | General issue; try again later |
| 503 | Requests-per-second limit exceeded |

## Lookups

### Get a host by IP address: services, software, location, AS, DNS, WHOIS

`GET /v3/global/asset/host/{host_id}`

- Takes: IP address
- Footprint: passive (the target is not contacted)
- Cost: 1 credit
- Plan: All plans, including Free

Returns one host as Censys currently sees it, or at a past point in time with at_time. Use fields or exclude_fields (not both) to trim the response.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `host_id` | path | string | yes | The IP address of the host Example: 203.0.113.7 |
| `organization_id` | query | string | no | Censys organization ID (UUID). If omitted, the user's free wallet is used where applicable Example: 11111111-2222-3333-4444-555555555555 |
| `at_time` | query | string | no | RFC 3339 timestamp, to view the host at that point in time Example: 2025-01-01T00:00:00Z |
| `fields` | query | string | no | Comma-separated fields to include, in dot notation; omit or * for all Example: ip,location.country |
| `exclude_fields` | query | string | no | Comma-separated fields to leave out; cannot be combined with fields Example: whois |

Response fields:

- `result.resource.ip` (string): The host's IP address
- `result.resource.services[]` (object): Services seen on the host: port, protocol, transport_protocol, software, labels, banner, cert, scan_time, threats, vulns
- `result.resource.service_count` (integer): Number of services
- `result.resource.location` (object): city, province, country, country_code, continent, postal_code, timezone, coordinates, registered_country
- `result.resource.autonomous_system` (object): asn, name, description, bgp_prefix, organization, country_code
- `result.resource.dns` (object): DNS names associated with the host
- `result.resource.whois` (object): WHOIS data for the address
- `result.resource.operating_system` (object): Detected operating system
- `result.resource.labels[]` (object): Labels Censys applied to the host
- `result.resource.privacy[]` (object): Privacy services used by the IP, such as VPNs, proxies or Tor
- `result.extensions` (object): Additional data

```bash
curl 'https://api.platform.censys.io/v3/global/asset/host/203.0.113.7' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "result": {
    "resource": {
      "ip": "203.0.113.7",
      "location": {
        "city": "Amsterdam",
        "country": "Netherlands",
        "country_code": "NL",
        "continent": "Europe",
        "timezone": "Europe/Amsterdam"
      },
      "autonomous_system": {
        "asn": 64500,
        "name": "EXAMPLE-NET",
        "description": "Example Networks",
        "bgp_prefix": "203.0.113.0/24",
        "country_code": "NL"
      },
      "service_count": 2,
      "services": [
        {
          "port": 22,
          "protocol": "SSH",
          "scan_time": "2025-01-01T00:00:00Z"
        },
        {
          "port": 443,
          "protocol": "HTTP",
          "scan_time": "2025-01-01T00:00:00Z"
        }
      ]
    },
    "extensions": {}
  }
}
```

### Get a host's event history between two times

`GET /v3/global/asset/host/{host_id}/timeline`

- Takes: IP address
- Footprint: passive (the target is not contacted)
- Plan: Not available to Free users (lookups only)

Lists events on a host: services scanned (including protocol changes after a new scan), forward and reverse DNS resolutions, location, route, JARM and WHOIS updates. start_time is the time closest to now and end_time the time furthest from now.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `host_id` | path | string | yes | IP address of the host Example: 203.0.113.7 |
| `start_time` | query | string | yes | RFC 3339 start of the timeline: the timestamp closest to now Example: 2025-01-02T00:00:00Z |
| `end_time` | query | string | yes | RFC 3339 end of the timeline: the timestamp furthest from now Example: 2025-01-01T00:00:00Z |
| `organization_id` | query | string | no | Censys organization ID (UUID) Example: 11111111-2222-3333-4444-555555555555 |

Response fields:

- `result.events[]` (object): Events, each with resource and extensions
- `result.events[].resource.event_time` (string): When the event happened
- `result.events[].resource.service_scanned` (object): Set for a service scan event
- `result.events[].resource.forward_dns_resolved` (object): Set for a forward DNS event
- `result.events[].resource.whois_updated` (object): Set for a WHOIS update
- `result.scanned_to` (string): Date the history has been scanned to

```bash
curl 'https://api.platform.censys.io/v3/global/asset/host/203.0.113.7/timeline?start_time=2025-01-02T00%3A00%3A00Z&end_time=2025-01-01T00%3A00%3A00Z' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "result": {
    "events": [
      {
        "resource": {
          "event_time": "2025-01-01T12:00:00Z",
          "service_scanned": {}
        },
        "extensions": {}
      }
    ],
    "scanned_to": "2025-01-02"
  }
}
```

### Get a web property by hostname and port

`GET /v3/global/asset/webproperty/{webproperty_id}`

- Takes: Domain
- Footprint: passive (the target is not contacted)
- Cost: 1 credit
- Plan: All plans, including Free

Returns one web property, identified as hostname:port (for example example.com:443): endpoints, software, certificate, TLS, JARM, labels, threats and vulnerabilities. Supports at_time, fields and exclude_fields.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `webproperty_id` | path | string | yes | Web property identifier: hostname and port Example: www.example.com:443 |
| `organization_id` | query | string | no | Censys organization ID (UUID) Example: 11111111-2222-3333-4444-555555555555 |
| `at_time` | query | string | no | RFC 3339 timestamp, to view the web property at that point in time Example: 2025-01-01T00:00:00Z |
| `fields` | query | string | no | Comma-separated fields to include, in dot notation Example: hostname,port,tls.cipher_selected |
| `exclude_fields` | query | string | no | Comma-separated fields to leave out; cannot be combined with fields Example: cert,endpoints.http.body |

Response fields:

- `result.resource.hostname` (string): Hostname
- `result.resource.port` (integer): Port
- `result.resource.scan_time` (string): When it was scanned
- `result.resource.endpoints[]` (object): Endpoints observed
- `result.resource.software[]` (object): Software detected
- `result.resource.cert` (object): Certificate presented
- `result.resource.jarm` (object): JARM fingerprint
- `result.resource.threats[]` (object): Threats detected
- `result.resource.vulns[]` (object): Vulnerabilities detected

```bash
curl 'https://api.platform.censys.io/v3/global/asset/webproperty/www.example.com%3A443' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "result": {
    "resource": {
      "hostname": "www.example.com",
      "port": 443,
      "scan_time": "2025-01-01T00:00:00Z",
      "endpoints": [],
      "software": [],
      "labels": []
    },
    "extensions": {}
  }
}
```

### Get a certificate by its SHA-256 fingerprint

`GET /v3/global/asset/certificate/{certificate_id}`

- Footprint: passive (the target is not contacted)
- Cost: 1 credit
- Plan: All plans, including Free

Returns one certificate: fingerprints, parsed subject and issuer, validity period, serial number, names, CT log data, revocation and validation status.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `certificate_id` | path | string | yes | The SHA-256 certificate fingerprint Example: 9a8b7c6d5e4f30211a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7081 |
| `organization_id` | query | string | no | Censys organization ID (UUID) Example: 11111111-2222-3333-4444-555555555555 |
| `fields` | query | string | no | Comma-separated fields to include, in dot notation Example: fingerprint_sha256,parsed.subject_dn |
| `exclude_fields` | query | string | no | Comma-separated fields to leave out; cannot be combined with fields Example: names,fingerprint_sha1 |

Response fields:

- `result.resource.fingerprint_sha256` (string): SHA-256 fingerprint (the certificate's ID)
- `result.resource.parsed.subject_dn` (string): Subject distinguished name
- `result.resource.parsed.issuer_dn` (string): Issuer distinguished name
- `result.resource.parsed.validity_period` (object): Validity period
- `result.resource.parsed.serial_number` (string): Serial number
- `result.resource.names[]` (string): Names on the certificate
- `result.resource.added_at` (string): When Censys added it
- `result.resource.revoked` (boolean): Whether it is revoked

```bash
curl 'https://api.platform.censys.io/v3/global/asset/certificate/9a8b7c6d5e4f30211a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7081' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "result": {
    "resource": {
      "fingerprint_sha256": "9a8b7c6d5e4f30211a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7081",
      "parsed": {
        "subject_dn": "CN=www.example.com",
        "issuer_dn": "C=US, O=Example CA, CN=Example CA R1",
        "serial_number": "123456789"
      },
      "names": [
        "www.example.com",
        "example.com"
      ],
      "added_at": "2025-01-01T00:00:00Z"
    },
    "extensions": {}
  }
}
```

## Search

### Search hosts, web properties and certificates with a CenQL query

`POST /v3/global/search/query`

- Footprint: passive (the target is not contacted)
- Cost: 1 credit per query, and 1 per further page
- Plan: Not available to Free users (lookups only)

Runs a Censys Query Language search. Each hit is a host (host_v1), web property (webproperty_v1) or certificate (certificate_v1); matching host services come back in matched_services. Page through results with page_token.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `organization_id` | query | string | no | Censys organization ID (UUID) Example: 11111111-2222-3333-4444-555555555555 |

Response fields:

- `result.hits[]` (object): Matches: host_v1, webproperty_v1 or certificate_v1, plus tags
- `result.total_hits` (number): Total number of matches
- `result.next_page_token` (string): Token for the next page
- `result.previous_page_token` (string): Token for the previous page
- `result.query_duration_millis` (integer): Query time in milliseconds

```bash
curl -X POST 'https://api.platform.censys.io/v3/global/search/query' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"query":"host.services: (protocol=SSH and not port: 22)","page_size":1}'
```

Example response (200):

```json
{
  "result": {
    "hits": [
      {
        "host_v1": {
          "resource": {
            "ip": "198.51.100.23",
            "services": [
              {
                "port": 2222,
                "protocol": "SSH"
              }
            ]
          }
        }
      }
    ],
    "total_hits": 1520,
    "next_page_token": "EXAMPLE_PAGE",
    "previous_page_token": "",
    "query_duration_millis": 180
  }
}
```

### Count matches of a CenQL query, bucketed by a field

`POST /v3/global/search/aggregate`

- Footprint: passive (the target is not contacted)
- Cost: 1 credit
- Plan: Not available to Free users (lookups only)

The API form of the Report Builder: splits the results of a query into buckets by a field (country, ASN, port, ...) without fetching every record.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `organization_id` | query | string | no | Censys organization ID (UUID) Example: 11111111-2222-3333-4444-555555555555 |

Response fields:

- `result.buckets[].key` (string): Bucket value
- `result.buckets[].count` (integer): Count in the bucket
- `result.total_count` (integer): Total count
- `result.other_count` (integer): Count outside the returned buckets
- `result.is_more_than_total_hits` (boolean): Whether the result exceeds total hits
- `result.query_duration_millis` (integer): Query time in milliseconds

```bash
curl -X POST 'https://api.platform.censys.io/v3/global/search/aggregate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"query":"host.services.protocol=SSH","field":"host.services.port","number_of_buckets":100}'
```

Example response (200):

```json
{
  "result": {
    "buckets": [
      {
        "key": "22",
        "count": 900
      },
      {
        "key": "2222",
        "count": 120
      }
    ],
    "total_count": 1100,
    "other_count": 80,
    "is_more_than_total_hits": false,
    "query_duration_millis": 95
  }
}
```

## Account

### Get a Free user's credit balance and reset date

`GET /v3/accounts/users/credits`

- Footprint: passive (the target is not contacted)
- Cost: No credits
- Plan: Free accounts

For Free user accounts; Starter and Enterprise accounts use the organization credit balance endpoint instead.

Response fields:

- `result.balance` (integer): Current credit balance
- `result.resets_at` (string): When the credits reset

```bash
curl 'https://api.platform.censys.io/v3/accounts/users/credits' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "result": {
    "balance": 87,
    "resets_at": "2025-02-01T00:00:00Z"
  }
}
```

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
