← 返回
数据分析 Key 中文

Hostinger

Manage Hostinger account via API — VPS administration (start/stop/restart, snapshots, backups, firewall, Docker), DNS zone management, domain portfolio, website hosting, and billing. Use when asked to deploy, publish, manage servers, configure DNS, or control any Hostinger service.
通过 API 管理 Hostinger 账户——VPS 管理(启动/停止/重启、快照、备份、防火墙、Docker)、DNS 区域管理、域名组合、网站托管及账单。在部署、发布、管理服务器、配置 DNS 或控制 Hostinger 服务时使用。
rexlunae
数据分析 clawhub v1.0.0 1 版本 99898 Key: 需要
★ 2
Stars
📥 1,919
下载
💾 26
安装
1
版本
#latest

概述

Hostinger API Skill

Control Hostinger services programmatically: VPS instances, DNS records, domains, websites, hosting.

Authentication

API token required. Get one from: https://hpanel.hostinger.com/profile/api

Store in ~/.config/hostinger/token (just the token, no newline):

mkdir -p ~/.config/hostinger
echo -n "YOUR_API_TOKEN" > ~/.config/hostinger/token
chmod 600 ~/.config/hostinger/token

Quick Reference

VPS Operations

# List all VPS instances
python3 scripts/hostinger.py vps list

# Get VPS details
python3 scripts/hostinger.py vps get <vm_id>

# Start/stop/restart VPS
python3 scripts/hostinger.py vps start <vm_id>
python3 scripts/hostinger.py vps stop <vm_id>
python3 scripts/hostinger.py vps restart <vm_id>

# Create/restore snapshots
python3 scripts/hostinger.py vps snapshot-create <vm_id>
python3 scripts/hostinger.py vps snapshot-restore <vm_id>

# View backups
python3 scripts/hostinger.py vps backups <vm_id>

DNS Management

# Get DNS records for domain
python3 scripts/hostinger.py dns get <domain>

# Update DNS records (JSON file with records array)
python3 scripts/hostinger.py dns update <domain> <records.json>

# Reset DNS to defaults
python3 scripts/hostinger.py dns reset <domain>

# DNS snapshots
python3 scripts/hostinger.py dns snapshots <domain>
python3 scripts/hostinger.py dns snapshot-restore <domain> <snapshot_id>

Domain Portfolio

# List all domains
python3 scripts/hostinger.py domains list

# Get domain details
python3 scripts/hostinger.py domains get <domain>

# Update nameservers
python3 scripts/hostinger.py domains nameservers <domain> ns1.example.com ns2.example.com

# Check availability
python3 scripts/hostinger.py domains check example.com example.org

Hosting/Websites

# List websites
python3 scripts/hostinger.py hosting websites

# List datacenters
python3 scripts/hostinger.py hosting datacenters

Billing

# View subscriptions
python3 scripts/hostinger.py billing subscriptions

# View payment methods
python3 scripts/hostinger.py billing payment-methods

# View catalog
python3 scripts/hostinger.py billing catalog

DNS Record Format

When updating DNS records, provide a JSON file:

{
  "records": [
    {"type": "A", "name": "@", "value": "1.2.3.4", "ttl": 300},
    {"type": "A", "name": "www", "value": "1.2.3.4", "ttl": 300},
    {"type": "MX", "name": "@", "value": "mail.example.com", "priority": 10, "ttl": 300},
    {"type": "TXT", "name": "@", "value": "v=spf1 include:_spf.google.com ~all", "ttl": 300}
  ]
}

VPS Docker Management

For VPS with Docker OS templates:

# List Docker projects
python3 scripts/hostinger.py docker list <vm_id>

# Deploy from docker-compose.yml URL
python3 scripts/hostinger.py docker deploy <vm_id> <project_name> --url <compose_url>

# Or from local file
python3 scripts/hostinger.py docker deploy <vm_id> <project_name> --file <compose.yml>

# Start/stop/restart project
python3 scripts/hostinger.py docker start <vm_id> <project_name>
python3 scripts/hostinger.py docker stop <vm_id> <project_name>
python3 scripts/hostinger.py docker restart <vm_id> <project_name>

# View logs
python3 scripts/hostinger.py docker logs <vm_id> <project_name>

# Delete project
python3 scripts/hostinger.py docker down <vm_id> <project_name>

VPS Firewall

# List firewalls
python3 scripts/hostinger.py firewall list

# Create firewall
python3 scripts/hostinger.py firewall create <name>

# Add rule
python3 scripts/hostinger.py firewall add-rule <firewall_id> --protocol tcp --port 443 --source 0.0.0.0/0

# Activate on VM
python3 scripts/hostinger.py firewall activate <firewall_id> <vm_id>

Direct API Access

For operations not covered by the script, use curl:

TOKEN=$(cat ~/.config/hostinger/token)
curl -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     https://developers.hostinger.com/api/vps/v1/virtual-machines

API Documentation

  • Full API reference: https://developers.hostinger.com
  • OpenAPI spec: https://github.com/hostinger/api/blob/main/openapi.json
  • Python SDK: https://github.com/hostinger/api-python-sdk
  • CLI tool: https://github.com/hostinger/api-cli

Common Workflows

Deploy a Website

  1. Get VPS ID: python3 scripts/hostinger.py vps list
  2. Update DNS to point to VPS: python3 scripts/hostinger.py dns update domain.com records.json
  3. SSH to VPS and deploy, OR use Docker: python3 scripts/hostinger.py docker deploy mysite --file docker-compose.yml

Secure a VPS

  1. Create firewall: python3 scripts/hostinger.py firewall create "web-server"
  2. Add rules for SSH, HTTP, HTTPS
  3. Activate: python3 scripts/hostinger.py firewall activate

Backup Before Changes

  1. Create snapshot: python3 scripts/hostinger.py vps snapshot-create
  2. Make changes
  3. If needed, restore: python3 scripts/hostinger.py vps snapshot-restore

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 22:18 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 166 📥 60,287
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,917
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 57,038