Package for making calls to metrics.tools API
Project description
metrics_tools
A simple python package for making API calls to metrics.tools API. https://metrics.tools/
It builds upon the requests package. The goal is to achiev an easy syntax for the API calls like: mt.domain('example.com').rankings.get()
Basic usage
from metrics_tools import MetricsTools
api_key = 'your api key'
mt = MetricsTools(api_key, verbose=True)
domain = mt.domain('example.com')
visibility = domain.sk.get()
rankings = domain.rankings.get()
keyword_details = mt.keyword('api').details.get()
Response
The response is parsed into a simple object with fields as object attributes. Additionaly it contains the requests response as '._response'.
example_domain.values # → if values are present
example_domain.json # → parsed json response
example_domain.result # → 'success' or 'error'
More Parameters
The API supports some additional parameters, respectifly filters, to narrow down the API answer. These filters can be used through the avalible functions.
#Visibility for specific date
domain.sk.from_('2018-05-07').get()
#Min and max visibility value
domain.sk.minmax().get()
#Ranking position for domain and given keyword
domain.position.for_keyword('jens fauldrath').get()
API calls
The minimum interval for calls is 0.2 sec.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
metrics_tools-0.0.1.tar.gz
(6.4 kB
view hashes)
Built Distribution
Close
Hashes for metrics_tools-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e47d91be12c12ab02adec4d783628dd56024bd5154e6393d6c92219bcf496871 |
|
MD5 | c01f1f6d43442918aee61aed6470e068 |
|
BLAKE2b-256 | 4c0c7952c3cdf802210f1a2846b4e307687ac467a3078fa798281e6f6b8c2f94 |