Skip to main content

Overview

This guide demonstrates how to use Smooth to retrieve invoice information from subscription services like Calendly. You’ll learn to authenticate manually once via a live URL, then have Smooth navigate to billing sections to extract payment data automatically.
1

Launch Session and Authenticate

Create a profile and session for Calendly. The profile will persist your authentication cookies.
Python
from smooth import SmoothClient

client = SmoothClient()

# Create the profile first (only needed once)
client.create_profile(profile_id="calendly-billing")

with client.session(profile_id="calendly-billing", url="https://calendly.com") as session:
    # Get the live URL for manual authentication
    print(f"Please log in at: {session.live_url()}")

    # Wait for user to authenticate
    input("Press Enter after you've logged in to Calendly...")

    # Now extract invoice data
    result = session.run_task(
        task="Go to the billing page and find my most recent invoice"
    )

    invoice = session.extract(
        schema={
            "type": "object",
            "properties": {
                "invoice_date": {"type": "string", "description": "Invoice date"},
                "amount_paid": {"type": "number", "description": "Amount paid"},
                "currency": {"type": "string", "description": "Currency code"},
                "invoice_number": {"type": "string", "description": "Invoice number"}
            }
        },
        prompt="Extract the most recent invoice details from this page"
    )

    print(f"Invoice: {invoice.output}")
Open the live_url in your browser and log in to Calendly. Once authenticated, press Enter to continue.
2

Reuse the Profile

In future runs, use the same profile ID to skip manual authentication and retrieve invoices directly.
Python
with client.session(profile_id="calendly-billing", url="https://calendly.com") as session:
    session.run_task(
        task="Navigate to the billing page"
    )

    invoices = session.extract(
        schema={
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "invoice_date": {"type": "string", "description": "Invoice date"},
                    "amount_paid": {"type": "number", "description": "Amount paid"},
                    "currency": {"type": "string", "description": "Currency code"},
                    "invoice_number": {"type": "string", "description": "Invoice number"}
                }
            }
        },
        prompt="Extract all invoices from the billing page"
    )

    for inv in invoices.output:
        print(f"{inv['invoice_date']}: {inv['currency']} {inv['amount_paid']}")

Use Cases

  • Expense Tracking: Automatically extract billing information for accounting
  • Budget Monitoring: Track recurring payments across multiple services
  • Invoice Automation: Integrate payment data with expense management systems
  • Audit Compliance: Maintain accurate records of business subscriptions
This approach works with any web service that has a billing dashboard. The key is authenticating manually first, then letting the agent navigate to extract the specific invoice data you need.

Community

Join Discord

Join our community for support and showcases