Skip to main content

similarweb REST API

Introduction

The similarweb REST API is a library that simplifies the access to the REST API of Similarweb.

Installation

To install the library, run the following command:

Copy code pip install similarweb-rest-api

Usage

To use the library, import the SimilarwebApi class and create an instance of it. Then, use the get method to make a request to the API.

from similarweb_rest_api import SimilarwebApi

api = SimilarwebApi()
response = api.get('website/traffic', domain='example.com', start_date='2020-01-01', end_date='2020-01-31')

The get method returns a SimilarwebResponse object, which contains the API response in various formats. To access the response in a specific format, use one of the following methods:

to_json: returns the response as a JSON string to_dataframe: returns the response as a Pandas DataFrame to_sql: returns an SQL statement to insert the response into a table to_xml: returns the response as an XML document to_excel: writes the response to an Excel file to_csv: writes the response to a CSV file to_html: returns the response as an HTML table to_jsonl: writes the response to a JSON Lines file to_yaml: returns the response as a YAML document

For example, to convert the response to a DataFrame and display the first 5 rows:

df = response.to_dataframe()
df.head()

Parameters

The following parameters can be passed to the get function:

name: The name of the API endpoint. domain: The domain to get data for. api_key: Your API key. start_date: The start date for the data range (in the format YYYY-MM). end_date: The end date for the data range (in the format YYYY-MM).

License

This library is free to use for non-commercial purposes. For commercial use, please contact the author for permission.

Contact

If you have any questions or suggestions, please contact the author Damien Frigewski at dfrigewski@gmail.com.

Metadata

Release files for similarweb-rest-api 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for similarweb-rest-api 0.1.1
File Size Uploaded Provenance Actions
similarweb_rest_api-0.1.1.tar.gz 18.6 kB Without provenance Details for similarweb_rest_api-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for similarweb-rest-api 0.1.1
File Interpreter ABI Platform Actions
similarweb_rest_api-0.1.1-py3.11.egg Legacy Egg format - - Details for similarweb_rest_api-0.1.1-py3.11.egg
similarweb_rest_api-0.1.1-py3-none-any.whl Python 3 none any Details for similarweb_rest_api-0.1.1-py3-none-any.whl

Total release size: 53.8 kB

Release files / similarweb_rest_api-0.1.1.tar.gz

Download URL similarweb_rest_api-0.1.1.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8629e9ff2bc0ae1a4fc2811c6e6f3134395541e9f333f5f8b0904ffc431c85fa
BLAKE2b-256 checksum
How to use checksums
fb444cd64f0b4c4706f1d1c7cfcff09c6186c65ef9b8a82250561f1542e69faa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / similarweb_rest_api-0.1.1-py3.11.egg

Download URL similarweb_rest_api-0.1.1-py3.11.egg
Size 17.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
12c44153e0570afee75f977dd19336995b76cc2182fc7728b36c8bd4df1d8709
BLAKE2b-256 checksum
How to use checksums
5d314c666127620380250afd2dee9d92fdc82b2bda32001e419bdbce0134c1ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / similarweb_rest_api-0.1.1-py3-none-any.whl

Download URL similarweb_rest_api-0.1.1-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f43572813dada9673d9ba3ae9656209d210e018309fa08b172b0af7cb9d2c320
BLAKE2b-256 checksum
How to use checksums
69810341e49c9fcee4d749d21003962b99d140d689dd26dd732781b40d4b2776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Security for similarweb-rest-api 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page