Skip to main content

Tools for working with the Tailscale API

Project description

Tailscale API tools

This repository contains tools for working with the Tailscale API.

Contents

tailscale_api

This module provides the TailscaleAPIClient object for working with the API. You can authenticate with the API using either an API access token or an OAuth client ID and secret.

import tailscale_api

tsc = tailscale_api.TailscaleAPIClient()

# authenticate with an access token
token = 'tskey-api-...'
tsc.set_token(token)
for device in tsc.devices():
    print(device.name)

# authenticate with oauth
ts_client_id = 'kHJw5W...'
ts_client_secret = 'tskey-client-...'
tsc.set_oauth_client_info(ts_client_id, ts_client_secret)
tsc.set_token(tsc.get_oauth_token())
for device in tsc.devices():
    print(device.name)

examples/check-devices.py

This script will check all devices in a Tailscale network, and send a notification email if any devices:

  • have a Tailscale software update available
  • have a machine key that will expire within 15 days
  • have a machine key that has already expired

This script is only provided as an example. If you want to use the script as it is written, you will need to provide Tailscale OAuth information and SMTP server credentials using environment variables.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tailscale_api-2025.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tailscale_api-2025.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file tailscale_api-2025.1.tar.gz.

File metadata

  • Download URL: tailscale_api-2025.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.3

File hashes

Hashes for tailscale_api-2025.1.tar.gz
Algorithm Hash digest
SHA256 3cfe35e8aadc123da93ab2f315b5ce7bf0244b37a695297d5763c6ba719d9bbe
MD5 3b1ca781887e7445222fec9a13ed7450
BLAKE2b-256 b3b9cd42f6fa466a64b5f605aa8b2a4060984765420f5896f186348c1aff0404

See more details on using hashes here.

File details

Details for the file tailscale_api-2025.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tailscale_api-2025.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f97e49ea7a41b9def90db1de716a90fb5d18340e204ba8ba266ec044e1b72a0
MD5 f31c23459ec3dffe6d633c9bca2b8714
BLAKE2b-256 864a8b9a559a461648502b8e35bfad7ac81b56192188e88f4fa147ff33c929f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page