https://github.com/pandatix/nvdapi
Unofficial but convenient Go wrapper around the NVD REST JSON API
https://github.com/pandatix/nvdapi
api cpe cve go nist nvd
Last synced: 5 months ago
JSON representation
Unofficial but convenient Go wrapper around the NVD REST JSON API
- Host: GitHub
- URL: https://github.com/pandatix/nvdapi
- Owner: pandatix
- License: mit
- Created: 2021-10-08T17:04:16.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-12T09:34:20.000Z (5 months ago)
- Last Synced: 2025-05-12T14:23:56.086Z (5 months ago)
- Topics: api, cpe, cve, go, nist, nvd
- Language: Go
- Homepage:
- Size: 148 KB
- Stars: 33
- Watchers: 1
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
It supports API v2 with full support of endpoints, and keep support of deprecated for v1 for the sake of History.
Notice that this Go module **does not** enforce the [recommended](https://nvd.nist.gov/developers/start-here#divRateLimits) rate limiting between each request.> **Warning**
>
> This product uses the NVD API but is not endorsed or certified by the NVD.## How to use
The following shows how to basically use the wrapper to get a CPE for a given wide CPE match string.
```golang
package mainimport (
"fmt"
"log"
"net/http""github.com/pandatix/nvdapi/v2"
)func main() {
apiKey := ""
client, err := nvdapi.NewNVDClient(&http.Client{}, apiKey)
if err != nil {
log.Fatal(err)
}resp, err := nvdapi.GetCPEs(client, nvdapi.GetCPEsParams{
CPEMatchString: ptr("cpe:2.3:*:microsoft"),
ResultsPerPage: ptr(1),
})
if err != nil {
log.Fatal(err)
}for _, prod := range resp.Products {
fmt.Println(prod.CPE.CPEName)
}
}func ptr[T any](t T) *T {
return &t
}
```