Metadata-Version: 2.1
Name: nvd-api
Version: 0.4.2
Summary: NVD API 2.0 Python API
Home-page: https://github.com/kannkyo/nvd-api
Keywords: NVD,security,vulnerability
Author: kannkyo
Author-email: 15080890+kannkyo@users.noreply.github.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: certifi (>=2022.12.7,<2023.0.0)
Requires-Dist: frozendict (>=2.3.4,<3.0.0)
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
Requires-Dist: setuptools (>=65.6.3,<67.0.0)
Requires-Dist: typing-extensions (>=4.4.0,<5.0.0)
Requires-Dist: urllib3 (>=1.26.13,<2.0.0)
Project-URL: Documentation, https://kannkyo.github.io/nvd-api/html/
Project-URL: Repository, https://github.com/kannkyo/nvd-api
Description-Content-Type: text/x-rst

=================
NVD API Client
=================


NVD API client is a community driven NVD API 2.0 client. 
This client support `Vulnerabilities`_ API and `Products`_ API.

.. _Vulnerabilities: https://nvd.nist.gov/developers/vulnerabilities
.. _Products: https://nvd.nist.gov/developers/products

.. image:: https://badge.fury.io/py/nvd-api.svg
    :target: https://badge.fury.io/py/nvd-api

.. image:: https://github.com/kannkyo/nvd-api/actions/workflows/python-ci.yml/badge.svg
    :target: https://github.com/kannkyo/nvd-api/actions/workflows/python-ci.yml

.. image:: https://codecov.io/gh/kannkyo/nvd-api/branch/main/graph/badge.svg?token=ASYLVG3X9O
    :target: https://codecov.io/gh/kannkyo/nvd-api

.. image:: https://github.com/kannkyo/nvd-api/actions/workflows/scorecards.yml/badge.svg
    :target: https://github.com/kannkyo/nvd-api/actions/workflows/scorecards.yml

.. image:: https://bestpractices.coreinfrastructure.org/projects/6889/badge
    :target: https://bestpractices.coreinfrastructure.org/projects/6889

Getting Start
=============

Products / CPE API
---------------------

This API's simple example is bellow.

.. code-block:: python

    from client import NvdApiClient
    from pprint import pprint

    client = NvdApiClient()

    response = client.get_cpes(
        cpe_name_id="87316812-5F2C-4286-94FE-CC98B9EAEF53",
        results_per_page=1,
        start_index=0
    )
    pprint(response)

`get_cpes` method check API's all constraints and limitations.

* cpeNameId and matchCriteriaId must be uuid format.
* cpeMatchString must be CPEv2.3 format.
* If filtering by keywordExactMatch, keywordSearch is REQUIRED.
* If filtering by the last modified date, both lastModStartDate and lastModEndDate are REQUIRED.
* resultsPerPage's maximum allowable limit is 10,000.

Products / Match Criteria API
-----------------------------

This API's simple example is bellow.

.. code-block:: python

    from client import NvdApiClient
    from pprint import pprint

    client = NvdApiClient()

    response = client.get_cpe_match(
        cve_id="CVE-2022-32223",
        results_per_page=1,
        start_index=0
    )
    pprint(response)

`get_cpe_match` method check API's all constraints and limitations.

* cveId is must be CVE ID format.
* If filtering by the last modified date, both lastModStartDate and lastModEndDate are REQUIRED.
* matchCriteriaId must be uuid format.
* resultsPerPage's maximum allowable limit is 5,000.

Vulnerabilities / CVE API
---------------------------

This API's simple example is bellow.

.. code-block:: python

    from client import NvdApiClient
    from pprint import pprint

    client = NvdApiClient()

    response = client.get_cves(
        cpe_name="cpe:2.3:o:debian:debian_linux:3.0:*:*:*:*:*:*:*",
        cvss_v2_metrics="AV:L/AC:L/Au:N/C:C/I:C/A:C",
        cvss_v2_severity="HIGH",
        results_per_page=1,
        start_index=1
    )
    pprint(response)

Vulnerabilities / CVE Change History API
-------------------------------------------

This API's simple example is bellow.

.. code-block:: python

    from client import NvdApiClient
    from pprint import pprint

    client = NvdApiClient()

    response = client.get_cve_history(
        change_start_date="2021-08-04T00:00:00.000",
        change_end_date="2021-10-23T00:00:00.000",
        event_name="CVE Rejected",
        results_per_page=1,
        start_index=1
    )
    pprint(response)

`get_cve_history` method check API's all constraints and limitations.

* If filtering by the change date, both changeStartDate and changeEndDate are REQUIRED.
* cveId is must be CVE ID format.
* resultsPerPage's maximum allowable limit is 5,000.

