nvd_api package

Subpackages

Submodules

nvd_api.client module

class nvd_api.client.CVSS_V2_SEVERITY(value)[source]

Bases: Enum

CVSS v2 severity level

HIGH = 'HIGH'
LOW = 'LOW'
MEDIUM = 'MEDIUM'
class nvd_api.client.CVSS_V3_SEVERITY(value)[source]

Bases: Enum

CVSS v3 severity level

CRITICAL = 'CRITICAL'
HIGH = 'HIGH'
LOW = 'LOW'
MEDIUM = 'MEDIUM'
class nvd_api.client.EVENT_NAME(value)[source]

Bases: Enum

“CVE associated with a specific type of change event name

CPE_DEPRECATION_REMAP = 'CPE Deprecation Remap'
CVE_MODIFIED = 'CVE Modified'
CVE_REJECTED = 'CVE Rejected'
CVE_SOURCE_UPDATE = 'CVE Source Update'
CVE_TRANSLATED = 'CVE Translated'
CVE_UNREJECTED = 'CVE Unrejected'
CWE_REMAP = 'CWE Remap'
INITIAL_ANALYSIS = 'Initial Analysis'
MODIFIED_ANALYSIS = 'Modified Analysis'
REANALYSIS = 'Reanalysis'
VENDOR_COMMENT = 'Vendor Comment'
class nvd_api.client.NvdApiClient(wait_time: int = 6000, request_timeout: int = 20000, max_retries: int = 3, api_key: str | None = None)[source]

Bases: object

NVD API Client class

MAX_PAGE_LIMIT_CPE_API = 10000
MAX_PAGE_LIMIT_CPE_MATCH_API = 5000
MAX_PAGE_LIMIT_CVE_API = 2000
MAX_PAGE_LIMIT_CVE_HISTORY_API = 5000
get_all_cpe_match(cve_id: str | None = None, last_mod_start_date: datetime | None = None, last_mod_end_date: datetime | None = None, match_criteria_id: str | None = None) CpeMatchOas[source]

All Match Criteria API # noqa: E501

Parameters:
  • cve_id (str, optional) – CVE ID. Defaults to None.

  • last_mod_start_date (datetime, optional) – search by modified date. Defaults to None.

  • last_mod_end_date (datetime, optional) – search by modified date. Defaults to None.

  • match_criteria_id (str, optional) – specific by UUID. Defaults to None.

Returns:

API Result

Return type:

CpeMatchOas

get_all_cpes(cpe_name_id: str | None = None, cpe_match_string: str | None = None, keyword_exact_match: bool = False, keyword_search: str | None = None, last_mod_start_date: datetime | None = None, last_mod_end_date: datetime | None = None, match_criteria_id: str | None = None) CpeOas[source]

All CPE API # noqa: E501

Parameters:
  • cpe_name_id (str, optional) – specific CPE record UUID. Defaults to None.

  • cpe_match_string (str, optional) – CPE Name. Defaults to None.

  • keyword_exact_match (bool, optional) – if CPE exactly match or not. Defaults to None. Defaults to False.

  • keyword_search (str, optional) – a word or phrase is found in the metadata title or reference links. Defaults to None.

  • last_mod_start_date (datetime, optional) – search CPE by modified date. Defaults to None.

  • last_mod_end_date (datetime, optional) – search CPE by modified date. Defaults to None.

  • match_criteria_id (str, optional) – search CPE by uuid. Defaults to None.

Returns:

API Result

Return type:

CpeOas

get_all_cve_history(change_start_date: datetime | None = None, change_end_date: datetime | None = None, cve_id: str | None = None, event_name: EVENT_NAME | None = None) CveHistoryOas[source]

All CVE Change History API # noqa: E501

Parameters:
  • change_start_date (datetime, optional) – search by changed date. Defaults to None.

  • change_end_date (datetime, optional) – search by changed date. Defaults to None.

  • cve_id (str, optional) – CVE ID. Defaults to None.

  • event_name (EVENT_NAME, optional) – returns all CVE associated with a specific type of change event. Defaults to None.

Returns:

API Result

Return type:

CveHistoryOas

get_all_cves(cpe_name: str | None = None, cve_id: str | None = None, cvss_v2_metrics: str | None = None, cvss_v2_severity: CVSS_V2_SEVERITY | None = None, cvss_v3_metrics: str | None = None, cvss_v3_severity: CVSS_V3_SEVERITY | None = None, cwe_id: str | None = None, has_cert_alerts: bool = False, has_cert_notes: bool = False, has_kev: bool = False, has_oval: bool = False, is_vulnerable: bool = False, keyword_exact_match: bool = False, keyword_search: str | None = None, last_mod_start_date: datetime | None = None, last_mod_end_date: datetime | None = None, no_rejected: bool = False, pub_start_date: datetime | None = None, pub_end_date: datetime | None = None, source_identifier: str | None = None, version_end: str | None = None, version_end_type: VERSION_TYPE | None = None, version_start: str | None = None, version_start_type: VERSION_TYPE | None = None, virtual_match_string: str | None = None) CveOas[source]

All CVE API # noqa: E501

Parameters:
  • cpe_name (str, optional) – CPE Name. Defaults to None.

  • cve_id (str, optional) – CVE ID. Defaults to None.

  • cvss_v2_metrics (str, optional) – CVSSv2 vector string. Defaults to None.

  • cvss_v2_severity (CVSS_V2_SEVERITY, optional) – CVSSv2 qualitative severity rating. Defaults to None.

  • cvss_v3_metrics (str, optional) – CVSSv3 vector string. Defaults to None.

  • cvss_v3_severity (CVSS_V3_SEVERITY, optional) – CVSSv3 qualitative severity rating. Defaults to None.

  • cwe_id (str, optional) – CWE ID. Defaults to None.

  • has_cert_alerts (bool, optional) – contain a Technical Alert from US-CERT. Defaults to False.

  • has_cert_notes (bool, optional) – contain a Vulnerability Note from CERT/CC. Defaults to False.

  • has_kev (bool, optional) – appear in CISA’s Known Exploited Vulnerabilities (KEV) Catalog. Defaults to False.

  • has_oval (bool, optional) – contain information from MITRE’s Open Vulnerability and Assessment Language (OVAL). Defaults to False.

  • is_vulnerable (bool, optional) – returns only CVE associated with a specific CPE. Defaults to False.

  • keyword_exact_match (bool, optional) – returns any CVE where a word or phrase. Defaults to False.

  • keyword_search (str, optional) – a word or phrase is found in the current description. Defaults to None.

  • last_mod_start_date (datetime, optional) – search by modified date. Defaults to None.

  • last_mod_end_date (datetime, optional) – search by modified date. Defaults to None.

  • no_rejected (bool, optional) – return the CVE API includes CVE records with the REJECT or Rejected status. Defaults to False.

  • pub_start_date (datetime, optional) – search by published date. Defaults to None.

  • pub_end_date (datetime, optional) – search by published date. Defaults to None.

  • source_identifier (str, optional) – returns CVE where the exact value of sourceIdentifier appears. Defaults to None.

  • version_end (str, optional) – return only the CVEs associated with CPEs in specific version ranges. Defaults to None.

  • version_end_type (VERSION_TYPE, optional) – return only the CVEs associated with CPEs in specific version ranges. Defaults to None.

  • version_start (str, optional) – return only the CVEs associated with CPEs in specific version ranges. Defaults to None.

  • version_start_type (VERSION_TYPE, optional) – return only the CVEs associated with CPEs in specific version ranges. Defaults to None.

  • virtual_match_string (str, optional) – CVE more broadly than cpeName. Defaults to None.

Returns:

API Result

Return type:

AsyncResult

get_cpe_match(cve_id: str | None = None, last_mod_start_date: datetime | None = None, last_mod_end_date: datetime | None = None, match_criteria_id: str | None = None, results_per_page: int | None = None, start_index: int | None = None) CpeMatchOas[source]

Match Criteria API # noqa: E501

Parameters:
  • cve_id (str, optional) – CVE ID. Defaults to None.

  • last_mod_start_date (datetime, optional) – search by modified date. Defaults to None.

  • last_mod_end_date (datetime, optional) – search by modified date. Defaults to None.

  • match_criteria_id (str, optional) – specific by UUID. Defaults to None.

  • results_per_page (int, optional) – max number of records (default is 5000). Defaults to None.

  • start_index (int, optional) – the index of the first match string. Defaults to None.

Returns:

API Result

Return type:

CpeMatchOas

get_cpes(cpe_name_id: str | None = None, cpe_match_string: str | None = None, keyword_exact_match: bool = False, keyword_search: str | None = None, last_mod_start_date: datetime | None = None, last_mod_end_date: datetime | None = None, match_criteria_id: str | None = None, results_per_page: int | None = None, start_index: int | None = None) CpeOas[source]

CPE API # noqa: E501

Parameters:
  • cpe_name_id (str, optional) – specific CPE record UUID. Defaults to None.

  • cpe_match_string (str, optional) – CPE Name. Defaults to None.

  • keyword_exact_match (bool, optional) – if CPE exactly match or not. Defaults to None. Defaults to False.

  • keyword_search (str, optional) – a word or phrase is found in the metadata title or reference links. Defaults to None.

  • last_mod_start_date (datetime, optional) – search CPE by modified date. Defaults to None.

  • last_mod_end_date (datetime, optional) – search CPE by modified date. Defaults to None.

  • match_criteria_id (str, optional) – search CPE by uuid. Defaults to None.

  • results_per_page (int, optional) – max number of CPE records (default is 10000). Defaults to None.

  • start_index (int, optional) – the index of the first match string. Defaults to None.

Returns:

API Result

Return type:

CpeOas

get_cve_history(change_start_date: datetime | None = None, change_end_date: datetime | None = None, cve_id: str | None = None, event_name: EVENT_NAME | None = None, results_per_page: int | None = None, start_index: int | None = None) CveHistoryOas[source]

CVE Change History API # noqa: E501

Parameters:
  • change_start_date (datetime, optional) – search by changed date. Defaults to None.

  • change_end_date (datetime, optional) – search by changed date. Defaults to None.

  • cve_id (str, optional) – CVE ID. Defaults to None.

  • event_name (EVENT_NAME, optional) – returns all CVE associated with a specific type of change event. Defaults to None.

  • results_per_page (int, optional) – max number of records (default is 5000). Defaults to None.

  • start_index (int, optional) – the index of the first match string. Defaults to None.

Returns:

API Result

Return type:

CveHistoryOas

get_cves(cpe_name: str | None = None, cve_id: str | None = None, cvss_v2_metrics: str | None = None, cvss_v2_severity: CVSS_V2_SEVERITY | None = None, cvss_v3_metrics: str | None = None, cvss_v3_severity: CVSS_V3_SEVERITY | None = None, cwe_id: str | None = None, has_cert_alerts: bool = False, has_cert_notes: bool = False, has_kev: bool = False, has_oval: bool = False, is_vulnerable: bool = False, keyword_exact_match: bool = False, keyword_search: str | None = None, last_mod_start_date: datetime | None = None, last_mod_end_date: datetime | None = None, no_rejected: bool = False, pub_start_date: datetime | None = None, pub_end_date: datetime | None = None, results_per_page: int = 2000, start_index: int | None = None, source_identifier: str | None = None, version_end: str | None = None, version_end_type: VERSION_TYPE | None = None, version_start: str | None = None, version_start_type: VERSION_TYPE | None = None, virtual_match_string: str | None = None) CveOas[source]

CVE API # noqa: E501

Parameters:
  • cpe_name (str, optional) – CPE Name. Defaults to None.

  • cve_id (str, optional) – CVE ID. Defaults to None.

  • cvss_v2_metrics (str, optional) – CVSSv2 vector string. Defaults to None.

  • cvss_v2_severity (CVSS_V2_SEVERITY, optional) – CVSSv2 qualitative severity rating. Defaults to None.

  • cvss_v3_metrics (str, optional) – CVSSv3 vector string. Defaults to None.

  • cvss_v3_severity (CVSS_V3_SEVERITY, optional) – CVSSv3 qualitative severity rating. Defaults to None.

  • cwe_id (str, optional) – CWE ID. Defaults to None.

  • has_cert_alerts (bool, optional) – contain a Technical Alert from US-CERT. Defaults to False.

  • has_cert_notes (bool, optional) – contain a Vulnerability Note from CERT/CC. Defaults to False.

  • has_kev (bool, optional) – appear in CISA’s Known Exploited Vulnerabilities (KEV) Catalog. Defaults to False.

  • has_oval (bool, optional) – contain information from MITRE’s Open Vulnerability and Assessment Language (OVAL). Defaults to False.

  • is_vulnerable (bool, optional) – returns only CVE associated with a specific CPE. Defaults to False.

  • keyword_exact_match (bool, optional) – returns any CVE where a word or phrase. Defaults to False.

  • keyword_search (str, optional) – a word or phrase is found in the current description. Defaults to None.

  • last_mod_start_date (datetime, optional) – search by modified date. Defaults to None.

  • last_mod_end_date (datetime, optional) – search by modified date. Defaults to None.

  • no_rejected (bool, optional) – return the CVE API includes CVE records with the REJECT or Rejected status. Defaults to False.

  • pub_start_date (datetime, optional) – search by published date. Defaults to None.

  • pub_end_date (datetime, optional) – search by published date. Defaults to None.

  • results_per_page (int, optional) – max number of records (default is 2000). Defaults to None.

  • start_index (int, optional) – the index of the first match string. Defaults to None.

  • source_identifier (str, optional) – returns CVE where the exact value of sourceIdentifier appears. Defaults to None.

  • version_end (str, optional) – return only the CVEs associated with CPEs in specific version ranges. Defaults to None.

  • version_end_type (VERSION_TYPE, optional) – return only the CVEs associated with CPEs in specific version ranges. Defaults to None.

  • version_start (str, optional) – return only the CVEs associated with CPEs in specific version ranges. Defaults to None.

  • version_start_type (VERSION_TYPE, optional) – return only the CVEs associated with CPEs in specific version ranges. Defaults to None.

  • virtual_match_string (str, optional) – CVE more broadly than cpeName. Defaults to None.

Returns:

API Result

Return type:

AsyncResult

update_last_exec_datetime()[source]
class nvd_api.client.VERSION_TYPE(value)[source]

Bases: Enum

CPEs specific version range type

EXCLUDING = 'excluding'
INCLUDING = 'including'

Module contents

NVD API 2.0 Python API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501

The version of the OpenAPI document: 0.1.0 Contact: 15080890+kannkyo@users.noreply.github.com Generated by: https://openapi-generator.tech