From ec03439b2f7824f606c257456278558bbae45f91 Mon Sep 17 00:00:00 2001
From: Pachakutiq <101460915+PACHAKUTlQ@users.noreply.github.com>
Date: Wed, 9 Apr 2025 02:11:22 +0800
Subject: [PATCH] style: Format README.md using prettier
---
README.md | 85 +++++++++++++++++++++++++++++++++++--------------------
1 file changed, 54 insertions(+), 31 deletions(-)
diff --git a/README.md b/README.md
index 0565f75..9f8962a 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,23 @@
# OpenSERP (Search Engine Results Page)
+

[](https://goreportcard.com/report/github.com/karust/openserp)
[](https://pkg.go.dev/github.com/karust/openserp)
[](https://github.com/karust/openserp/releases)
+
+
API access for search engines results if available isn't free.
Using OpenSERP, you can get search results from **Google**, **Yandex**, **Baidu** via API or CLI!
See [Docker](#docker) and [CLI](#cli) usage examples below ([search](#search), [images](#images)).
-## Docker usage 馃惓
-* Run API server:
+## Docker usage 馃惓
+
+- Run API server:
+
```bash
# Use prebuilt image
docker run -p 127.0.0.1:7000:7000 -it karust/openserp serve -a 0.0.0.0 -p 7000
@@ -22,26 +27,32 @@ docker-compose up --build
```
### Request parameters
-| Param | Description |
-|-------|--------------------------------------------------------------|
-| text | Text to search |
-| lang | Search pages in selected language (`EN`, `DE`, `RU`...) |
-| date | Date in `YYYYMMDD..YYYYMMDD` format (e.g. 20181010..20231010) |
-| file | File extension to search (e.g. `PDF`, `DOC`) |
-| site | Search within a specific website |
-| limit | Limit the number of results
-| answers | Include google answers as negative rank indexes (e.g. `true`, `false`)
+
+| Param | Description |
+| ------- | ---------------------------------------------------------------------- |
+| text | Text to search |
+| lang | Search pages in selected language (`EN`, `DE`, `RU`...) |
+| date | Date in `YYYYMMDD..YYYYMMDD` format (e.g. 20181010..20231010) |
+| file | File extension to search (e.g. `PDF`, `DOC`) |
+| site | Search within a specific website |
+| limit | Limit the number of results |
+| answers | Include google answers as negative rank indexes (e.g. `true`, `false`) |
### **Search**
-### *Example request*
+
+### _Example request_
+
Get 20 **Google** results for `hello world`, only in English:
+
```
GET http:/127.0.0.1:7000/google/search?lang=EN&limit=20&text=hello world
```
-You can replace `google` to `yandex` or `baidu` in query to change search engine.
- |
-### *Example response*
+You can replace `google` to `yandex` or `baidu` in query to change search engine.
+|
+
+### _Example response_
+
```JSON
[
{
@@ -53,39 +64,51 @@ You can replace `google` to `yandex` or `baidu` in query to change search engine
},
]
```
+
### **Images** **[WIP]**
-### *Example request*
+
+### _Example request_
+
Get 100 **Google** results for `golden puppy`:
+
```
GET http://127.0.0.1:7000/google/image?text=golden puppy&limit=100
```
-
## CLI 鈱笍
-* Use `-h` flag to see commands.
-* You can use `serve` command to serve API:
+
+- Use `-h` flag to see commands.
+- You can use `serve` command to serve API:
+
```bash
-openserp serve
+openserp serve
```
-* Or print results in CLI using `search` command:
+
+- Or print results in CLI using `search` command:
+
```bash
openserp search google "how to get banned from google fast" # Change `google` to `yandex` or `baidu`
```
+
As a result you should get JSON output containting search results:
+
```json
[
- {
- "rank": 1,
- "url": "https://www.cyberoptik.net/blog/6-sure-fire-ways-to-get-banned-from-google/",
- "title": "11 Sure-Fire Ways to Get Banned From Google | CyberOptik",
- "description": "How To Get Banned From Google 路 1. Cloaking: The Art of Deception 路 2. Plagiarism: Because Originality is Overrated 路 3. Keyword Stuffing: More is Always Better 路 4 ...",
- "ad": false
- },
+ {
+ "rank": 1,
+ "url": "https://www.cyberoptik.net/blog/6-sure-fire-ways-to-get-banned-from-google/",
+ "title": "11 Sure-Fire Ways to Get Banned From Google | CyberOptik",
+ "description": "How To Get Banned From Google 路 1. Cloaking: The Art of Deception 路 2. Plagiarism: Because Originality is Overrated 路 3. Keyword Stuffing: More is Always Better 路 4 ...",
+ "ad": false
+ }
]
- ```
+```
+
+## License
- ## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
## Bugs + Questions 馃懢
-If you have some issues/bugs/questions, feel free to open an issue.
\ No newline at end of file
+
+If you have some issues/bugs/questions, feel free to open an issue.
+