Skip to content

Commit 54676f2

Browse files
committed
README update
1 parent 64f1a5c commit 54676f2

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

README.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,33 @@ A simple Python client example to send requests and get results from [DataForSEO
44

55
## Setup
66

7-
1. Clone this repo:
7+
__1. Clone this repo:__
88

9-
$ git clone git@gitlab.com:databulle/dataforseo-serp-api-python-client.git
9+
$ git clone git@gitlab.com:databulle/dataforseo-serp-api-python-client.git
1010
$ cd dataforseo-serp-api-python-client
1111

12-
2. (Optional) Setup a new [pyenv](https://github.com/pyenv/pyenv) virtual environment:
1312

14-
$ pyenv virtualenv 3.7.0 dataforseo
13+
__2. (Optional) Setup a new [pyenv](https://github.com/pyenv/pyenv) virtual environment:__
14+
15+
$ pyenv virtualenv 3.7.0 dataforseo
1516
$ pyenv local dataforseo
1617

17-
3. Get your credentials from DataForSEO:
18+
19+
__3. Get your credentials from DataForSEO:__
1820

1921
Go to [the API dashboard](https://app.dataforseo.com/api-dashboard) and get your `API Login` and `API Password`.
2022

21-
4. Create you `config.ini` file:
23+
24+
__4. Create you `config.ini` file:__
2225

2326
Copy the sample config file:
2427

2528
$ cp config.sample.ini config.ini
2629

2730
Edit the new file and fill in your login and password
2831

29-
5. That's all!
32+
33+
__5. That's all!__
3034

3135
### Sandbox
3236

@@ -46,6 +50,26 @@ Remember to switch it back when things get real ;)
4650

4751
### 1. Post tasks
4852

53+
Put the list of keywords in a text file (one request per line), then run:
54+
55+
$ python tasks_post.py --input yourfile.txt
56+
57+
The script will send the keywords to the API by batches of 100 requests, and write a report containing the `task_id` for each keyword.
58+
59+
The `input` argument is required. Other options are available:
60+
- `config`: configuration file to use (default: `config.ini`)
61+
- `input`: input file with the list of requests (required)
62+
- `output`: output basename for the report (default: `keyword-requests`)
63+
- `language_code`: language code for the requests (default: `fr`)
64+
- `location_code`: location code for requests (default: "2250" for France, get other codes on <https://api.dataforseo.com/v3/serp/google/locations>)
65+
- `nb_results`: number of results to ask for (default: `10`)
66+
- `device`: choice between `desktop` (default) and `mobile`
67+
- `priority`: choose the priority queue between `low` (default) and `high` (note: `high` priority requests will be charged more by DataForSEO)
68+
- `batch`: number of requests to send for each batch, between 1 and 100 (default: `100`)
69+
- `delay`: delay in seconds between batches of requests (default: `10`)
70+
- `sep`: CSV separator for `output`(default: `;`)
71+
72+
4973
### 2. See if tasks are ready
5074

5175
This step is not required, but will show you how many of your requests have been processed and are available for download.

0 commit comments

Comments
 (0)