Skip to main content

Go2 SDK for Python

PyPI version Python 3.8+

Official Python SDK for the Go2 gRPC API - Smart App Links Platform.

Installation

pip install go2-sdk

Quick Start

from go2_sdk import Go2Client

with Go2Client(api_key="go2_your_api_key") as client:
    # Create a smart link
    link = client.links.create(
        slug="myapp",
        title="My Awesome App",
        ios_url="https://apps.apple.com/app/id123456",
        android_url="https://play.google.com/store/apps/details?id=com.myapp",
        web_url="https://myapp.com"
    )
    print(f"Created: https://go2.ge/{link.slug}")

    # Get analytics
    stats = client.analytics.get_stats(link.id, period="7d")
    print(f"Total clicks: {stats.total_clicks}")

Available Services

Links

Create and manage smart links that redirect users to the right app store.

# List all links
links = client.links.list(page=1, per_page=20)

# Create a link
link = client.links.create(
    slug="myapp",
    title="My App",
    ios_url="https://apps.apple.com/...",
    android_url="https://play.google.com/...",
    web_url="https://myapp.com",
    fallback_url="https://myapp.com/download"
)

# Get a link
link = client.links.get("link-id")

# Update a link
link = client.links.update("link-id", title="New Title", is_active=False)

# Delete a link
client.links.delete("link-id")

Analytics

Access detailed click analytics for your links.

# Get overview stats
stats = client.analytics.get_stats(link_id="...", period="30d")

# Get timeseries data
timeseries = client.analytics.get_timeseries(link_id="...", period="7d")

# Get platform breakdown
platforms = client.analytics.get_platforms(link_id="...", period="30d")

# Get country breakdown
countries = client.analytics.get_countries(link_id="...", period="30d", limit=10)

# Get referrer breakdown
referrers = client.analytics.get_referrers(link_id="...", period="30d", limit=10)

Domains

Add and manage custom domains.

# List domains
domains = client.domains.list()

# Add a domain
domain = client.domains.create(domain="links.myapp.com")

# Verify a domain
domain = client.domains.verify("domain-id")

# Delete a domain
client.domains.delete("domain-id")

QR Codes

Generate customizable QR codes for your links.

qr = client.qr.generate(
    link_id="...",
    size=512,
    format="png",
    foreground_color="#000000",
    background_color="#FFFFFF"
)
print(f"QR Code URL: {qr.url}")

Integrations

Connect with third-party services (Slack, Discord, Telegram, etc.).

from go2_sdk import IntegrationType, IntegrationConfig

# List integrations
integrations = client.integrations.list()

# Create an integration
integration = client.integrations.create(
    type=IntegrationType.SLACK,
    name="Marketing Alerts",
    config=IntegrationConfig(webhook_url="https://hooks.slack.com/..."),
    events=["click_alert", "click_milestone"]
)

# Test an integration
result = client.integrations.test("integration-id")

# Delete an integration
client.integrations.delete("integration-id")

Campaigns

Create SMS/Email marketing campaigns with bulk trackable links.

# Create a campaign
campaign = client.campaigns.create(
    name="Summer Sale 2024",
    base_link_id="...",
    type="sms",
    utm_source="sms",
    utm_campaign="summer_sale"
)

# Generate unique links for recipients
result = client.campaigns.generate_links(
    id=campaign.id,
    recipients=[
        {"identifier": "+1234567890", "metadata": {"name": "John"}},
        {"identifier": "+0987654321", "metadata": {"name": "Jane"}},
    ]
)

# Get campaign stats
stats = client.campaigns.get_stats(campaign.id)
print(f"Click rate: {stats.click_rate}%")

# Export links
export = client.campaigns.export_links(campaign.id, format="csv")

Error Handling

from go2_sdk import (
    Go2Client,
    Go2Error,
    NotFoundError,
    AuthenticationError,
    ValidationError,
    RateLimitError,
)

try:
    link = client.links.get("invalid-id")
except NotFoundError:
    print("Link not found")
except AuthenticationError:
    print("Invalid API key")
except ValidationError as e:
    print(f"Validation error: {e}")
except RateLimitError:
    print("Rate limit exceeded, try again later")
except Go2Error as e:
    print(f"API error: {e}")

Configuration

# Production (default)
client = Go2Client(api_key="go2_xxx")

# Custom endpoint (for development)
client = Go2Client(
    api_key="go2_xxx",
    endpoint="localhost:9090",
    insecure=True  # Disable TLS for local dev
)

Documentation

Full API documentation: https://app.go2.ge/docs#sdks

Requirements

  • Python 3.8+
  • grpcio >= 1.59.0
  • protobuf >= 4.25.0

License

MIT

Metadata

Release files for go2-sdk 1.2.7

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

Source distribution (sdist)

Source distribution for go2-sdk 1.2.7
File Size Uploaded
go2_sdk-1.2.7.tar.gz 32.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for go2-sdk 1.2.7
File Interpreter ABI Platform
go2_sdk-1.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 70.7 kB

Release files / go2_sdk-1.2.7.tar.gz

Download URL go2_sdk-1.2.7.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f1e86f8e215a63cbfc5c76edd0bd875b8e58d9c8379f4cf4c7565e829533d725
BLAKE2b-256 checksum
How to use checksums
6fc6013d74197423f3210b74a6bdc718c51ec7126031b54f8eb358d8944e7004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / go2_sdk-1.2.7-py3-none-any.whl

Download URL go2_sdk-1.2.7-py3-none-any.whl
Size 38.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ffe2d06536a15e622d8d1139dfdccbddaef516a9b0c0c084a8f27ca447dd824
BLAKE2b-256 checksum
How to use checksums
4d011f57c1ded546c858107fc5977e7d694b2a3f340e38ae5348a10136ba1d48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

1.2.7 This release

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.0.0

2 release files

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