File tree Expand file tree Collapse file tree 2 files changed +47
-25
lines changed Expand file tree Collapse file tree 2 files changed +47
-25
lines changed Original file line number Diff line number Diff line change 1
1
# DataForSEO SERP API Python Client
2
2
3
+ A simple Python client example to send requests and get results from [ DataForSEO SERP API] ( https://dataforseo.com/apis/serp-api ) .
4
+
3
5
## Setup
4
6
7
+ 1 . Clone this repo:
8
+
9
+ $ git clone git@gitlab.com : databulle /dataforseo-serp-api-python-client.git
10
+ $ cd dataforseo-serp-api-python-client
11
+
12
+ 2 . (Optional) Setup a new [ pyenv] ( https://github.com/pyenv/pyenv ) virtual environment:
13
+
14
+ $ pyenv virtualenv 3.7.0 dataforseo
15
+ $ pyenv local dataforseo
16
+
17
+ 3 . Get your credentials from DataForSEO:
18
+
19
+ Go to [ the API dashboard] ( https://app.dataforseo.com/api-dashboard ) and get your ` API Login ` and ` API Password ` .
20
+
21
+ 4 . Create you ` config.ini ` file:
22
+
23
+ Copy the sample config file:
24
+
25
+ $ cp config.sample.ini config.ini
26
+
27
+ Edit the new file and fill in your login and password
28
+
29
+ 5 . That's all!
30
+
31
+ ### Sandbox
32
+
33
+ If you want to test the API, you can simply edit the ` client.py ` file and replace on line 7:
34
+
35
+ domain = "api.dataforseo.com"
36
+
37
+ With:
38
+
39
+ domain = "sandbox.dataforseo.com"
40
+
41
+ The sandbox API lets you post as many requests as necessary to try your setup, and can send you dummy data.
42
+ Remember to switch it back when things get real ;)
43
+
44
+
5
45
## Usage
6
46
7
47
### 1. Post tasks
8
48
9
49
### 2. See if tasks are ready
10
50
51
+ This step is not required, but will show you how many of your requests have been processed and are available for download.
52
+ Simply run:
53
+
54
+ $ python tasks_ready.py
55
+
56
+
57
+
11
58
### 3. Get results
12
59
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments