https://github.com/karust/openserp
Get Google, Yandex, Baidu search engine results via API or CLI for free ๐
https://github.com/karust/openserp
baidu google search search-engine serp serpapi yandex
Last synced: 5 months ago
JSON representation
Get Google, Yandex, Baidu search engine results via API or CLI for free ๐
- Host: GitHub
- URL: https://github.com/karust/openserp
- Owner: karust
- License: mit
- Created: 2023-06-23T00:03:08.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-11T23:57:44.000Z (12 months ago)
- Last Synced: 2024-08-17T08:05:19.267Z (9 months ago)
- Topics: baidu, google, search, search-engine, serp, serpapi, yandex
- Language: Go
- Homepage:
- Size: 164 KB
- Stars: 291
- Watchers: 8
- Forks: 26
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```bash
# Use prebuilt image
docker run -p 127.0.0.1:7000:7000 -it karust/openserp serve -a 0.0.0.0 -p 7000# Or build one and run using docker-compose.yaml
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`)### **Search**
### *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*
```JSON
[
{
"rank": 1,
"url": "https://en.wikipedia.org/wiki/%22Hello,_World!%22_program",
"title": "\"Hello, World!\" program",
"description": "A \"Hello, World!\" program is generally a computer program that ignores any input, and outputs or displays a message similar to \"Hello, World!\".",
"ad": false
},
]
```
### **Images** **[WIP]**
### *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:
```bash
openserp serve
```
* 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
},
]
```## 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.