Skip to content

Commit 16888eb

Browse files
committed
chg: [doc] updated to include the unique api endpoint
1 parent 22fd8e1 commit 16888eb

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# CPE guesser
22

3-
CPE guesser is a command-line or web service to guess the CPE name based on one or more keyword(s). Then the result can
4-
be used against [cve-search](https://github.com/cve-search/cve-search) to do actual searches by CPE names.
3+
CPE Guesser is a command-line tool or web service designed to guess the CPE name based on one or more keywords. The resulting CPE can then be used with tools like [cve-search](https://github.com/cve-search/cve-search) or [vulnerability-lookup](https://github.com/cve-search/vulnerability-lookup) to perform actual searches using CPE names.
54

65
## Requirements
76

@@ -10,11 +9,15 @@ be used against [cve-search](https://github.com/cve-search/cve-search) to do act
109

1110
## Usage
1211

13-
To use CPE guesser, you have to initialise the [Valkey](https://valkey.io/) database with `import.py`.
12+
To use CPE Guesser, you need to initialize the [Valkey](https://valkey.io/) database with `import.py`.
1413

15-
Then you can use the software with `lookup.py` to find the most probable CPE matching the keywords provided.
14+
Once initialized, you can use the software with `lookup.py` to find the most probable CPE matching the provided keywords.
1615

17-
Or by calling the Web server (After running `server.py`), example: `curl -s -X POST http://localhost:8000/search -d "{\"query\": [\"tomcat\"]}" | jq .`
16+
Alternatively, you can call the web server (after running `server.py`). For example:
17+
18+
```bash
19+
curl -s -X POST http://localhost:8000/search -d '{"query": ["tomcat"]}' | jq .
20+
```
1821

1922
### Installation
2023

@@ -76,18 +79,29 @@ curl -s -X POST https://cpe-guesser.cve-search.org/search -d "{\"query\": [\"out
7679
]
7780
```
7881

82+
The endpoint `/unique` is available to retrieve only the best-matching CPE entry.
83+
84+
```bash
85+
curl -s -X POST https://cpe-guesser.cve-search.org/unique -d "{\"query\": [\"outlook\", \"connector\"]}" | jq .
86+
```
87+
88+
```json
89+
"cpe:2.3:a:oracle:corporate_time_outlook_connector"
90+
```
91+
7992
### Command line - `lookup.py`
8093

8194
```text
82-
usage: lookup.py [-h] WORD [WORD ...]
95+
usage: lookup.py [-h] [--unique] WORD [WORD ...]
8396
8497
Find potential CPE names from a list of keyword(s) and return a JSON of the results
8598
8699
positional arguments:
87100
WORD One or more keyword(s) to lookup
88101
89-
optional arguments:
102+
options:
90103
-h, --help show this help message and exit
104+
--unique Return the best CPE matching the keywords given
91105
```
92106

93107
```bash

0 commit comments

Comments
 (0)