Skip to content

Quick Start

This guide will get you up and running with Mapilli in just a few minutes.

Command Line

After installation, the mapilli command is available.

Query a User

mapilli alice@example.com

Query with Separate Host

mapilli alice -h example.com

List All Users

Query without a username to list all users:

mapilli -h example.com

Verbose Output

Request verbose (whois-style) output:

mapilli -W alice@example.com

Python API

Basic Usage

import asyncio
from mapilli import FingerClient

async def main():
    async with FingerClient() as client:
        response = await client.query("alice@example.com")
        print(response.body)

asyncio.run(main())

Query Options

async with FingerClient() as client:
    # Host in query string
    response = await client.query("alice@example.com")

    # Separate host parameter
    response = await client.query("alice", host="example.com")

    # List all users
    response = await client.query(host="example.com")

    # Verbose output
    response = await client.query("/W alice@example.com")

Custom Timeout

client = FingerClient(timeout=10.0)

async with client:
    response = await client.query("alice@example.com")

Error Handling

async with FingerClient(timeout=5.0) as client:
    try:
        response = await client.query("alice@example.com")
        print(response.body)
    except TimeoutError:
        print("Request timed out")
    except ConnectionError as e:
        print(f"Connection failed: {e}")
    except ValueError as e:
        print(f"Invalid query: {e}")

Next Steps