Skip to content

API Examples

The public eCrime.ch API examples repository contains small Python scripts for common reporting and integration workflows.

No support is available for scripts published in this GitHub repository.

The examples are provided as-is and are intended as starting points. Users are responsible for reviewing, testing, securing, adapting, scheduling, and operating them in their own environments.

Support for the eCrime.ch API itself remains subject to the applicable eCrime.ch support agreement.

The daily CSV email script retrieves newly listed victims, removes duplicate records, generates an Excel-friendly CSV file, and sends it through a customer-provided SMTP server.

It supports a dry-run mode that creates the CSV without sending email.

The regional report generator creates monthly country or multi-country reports using eCrime.ch API data.

It produces:

  • HTML and Markdown reports
  • an incident CSV
  • a JSON summary
  • SVG charts for trends, actors, and sectors

The generator has no fixed local paths and does not require Chromium.

Clone the repository and install its dependency:

Terminal window
git clone https://github.com/ecrime-ch/ecrime-api-examples.git
cd ecrime-api-examples
python3 -m pip install -r requirements.txt

Keep API keys and other credentials in environment variables. Never commit them to source control.