Skip to main content

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()

Note: I am not professional programmer. Install at your own risk. Useful tips are welcome :-).

Install via pip

pip install metrics-tools

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


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.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metrics_tools-0.0.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file metrics_tools-0.0.2.tar.gz.

File metadata

  • Download URL: metrics_tools-0.0.2.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for metrics_tools-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0e0386502ff9060c259a28166cfcd025ce81978107ace3c331348682da258d4b
MD5 246f52c62d9fabd3c2b6adc0a7a22f55
BLAKE2b-256 1bbaec480f7260a09f8c45628ccb836b3a5aa0074ebc6c164e1caee9a9542ba6

See more details on using hashes here.

File details

Details for the file metrics_tools-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for metrics_tools-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 979e80bf95b4e513526cd9aa25dc613b37186c37fcb8371313f13ed8dd6f4937
MD5 e8a6c3a5d3ffc4605c4deca387f2266e
BLAKE2b-256 ee3cbb6fbed664fe78599225fed332b728e5bf0350708952df81a7509e31f19b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page