A quick client to use Auhtoritas SERPs API in Python.
Have a look here: https://www.authoritas.com/keyword-ranking-api/.
These scripts have been tested with Python 3.7.0
I recommend using pyenv or any other virtual environment manager.
To install dependencies, simply run:
pip install -r requirements.txt
Two steps:
- send queries to the API
- ask for results
Using the send_queries.py script, you'll be able to send your list of queries to Authoritas SERPs API quite simply.
Put your queries into a simple text file (one query per line) and use this command:
python send_queries.py --input your_queries.txt
Each query will be sent to the API and the corresponding job id will be saved into a CSV file.
The script offers multiple options:
-ior--input: the mandatory input file (one query per line)-oor--output: a basename to create your output file (default:queries)--sep: output CSV separator (default is ";")-nor--nb_res: number of results to fetch (default: 10)-sor--search_enginethe search engine to use (choose betweengoogle,bing,yahoo,yandexandbaidu, default isgoogle)-ror--region: the search engine region (choose betweenglobal,fr,gb,usores, default isglobal)-lor--language: the search engine language (choose betweenen,frores, default isen)-uor--user_agent: the type of device to use (choose betweenpc,mac,tablet,ipad,iphoneandmobile, default ispc)--no_cache: to force the API not to use cached results (default: False)-dor--delay: the delay in seconds between requests (default: 2)
Use the get_results.py script to fetch results from jobs:
python get_results.py --input job_ids.csv
The script will fetch results for each jid and save SEO results to a CSV file, containing for each result in a SERP:
- the query,
- the job id,
- the job status,
- the result position,
- the page,
- the url,
- the result title.
Other data is available through the API, check the docs for more details.
Here is a list of available script options:
-ior--input: a CSV file containing aqueryand ajidcolumns (usingsend_queries.pyoutput is easiest)--input_sep: specify an input CSV separator (default is ";")-oor--output: a basename to create your output file (default isresults)--sep: output CSV separator (default is ";")-dor--delaythe delay in seconds between requests (default: 2)
If you wish to contribute to this repository or to report an issue, please do this on GitLab.