Skip to content

Commit

Permalink
README: update
Browse files Browse the repository at this point in the history
  • Loading branch information
deedy5 committed May 26, 2024
1 parent ad01820 commit ac88aca
Showing 1 changed file with 19 additions and 27 deletions.
46 changes: 19 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
# duckduckgo_search_api
# Duckduckgo_search_api

Deploy an API that pulls data from duckduckgo search engine.

## Usage
### 1) Simple (pull from hub.docker.com)
```python3
docker run -p 8000:8000 deedy5/duckduckgo_search_api
```
**check**</br>
[http://127.0.0.1:8000/](http://127.0.0.1:8000/)</br>
[http://127.0.0.1:8000/text?q=test&max_results=5](http://127.0.0.1:8000/text?q=test&max_results=5)

___
## 1) Usage
**clone**
### 2) Advanced (build yourself)
clone
```python3
git clone https://github.com/deedy5/duckduckgo_search_api.git
cd duckduckgo_search_api
```
**add PROXY and set TIMEOUT in main.py** (*example with [iproyal residential proxies](https://iproyal.com?r=residential_proxies)*)
add PROXY and set TIMEOUT in main.py (*example with [iproyal residential proxies](https://iproyal.com?r=residential_proxies)*)
```python3
...
TIMEOUT = 20
PROXY = "socks5://user:[email protected]:32325"
...
```
**run**
create venv and install requirements
```python3
python -m pip install -U -r requirements.txt
python start.py
python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt
```

**check**</br>
[http://127.0.0.1:8000/](http://127.0.0.1:8000/)</br>
[http://127.0.0.1:8000/ddg?q=test](http://127.0.0.1:8000/ddg?q=test)

___
## 2) Docker-compose
**run**
build and run using `docker-compose`
```python3
docker-compose up --build
```
___
## 3) Docker
build and run using `docker`
```python3
# build
docker build -t ddgs .
# run
docker run -d --name ddgs -p 8000:8000 --dns 1.1.1.1 --dns 8.8.8.8 ddgs
```
___
## 4) Test
```python3
python -m pytest
```
```

0 comments on commit ac88aca

Please sign in to comment.