-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` | ||
``` |