VPS.org API

REST API 文件

计划 API

获取有关可用 VPS 方案、定价和资源规格的信息。

终点 2 endpoints
基本路径 /api/v1/plans
得到 /api/v1/plans/

列出所有方案

获取一份列有定价和资源规格的 VPS 计划清单。

查询参数

参数 类型 必需的 说明说明
location string 否 无 Filter plans by datacenter location

示例请求

cURL
Python
JavaScript
PHP
curl -X GET "https://admin.vps.org/api/v1/plans/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
import requests

url = "https://admin.vps.org/api/v1/plans/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/plans/', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

const plans = await response.json();
console.log(plans);
$ch = curl_init('https://admin.vps.org/api/v1/plans/');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$plans = json_decode($response, true);
curl_close($ch);

示例回复

{
  "count": 4,
  "results": [
    {
      "id": 1,
      "name": "Starter VPS",
      "slug": "starter",
      "vcpus": 1,
      "memory": 2048,
      "storage": 40,
      "bandwidth": 1024,
      "price_monthly": 5.00,
      "price_hourly": 0.007,
      "available": true,
      "locations": ["us-west", "us-east", "eu-central"],
      "description": "Perfect for small projects and testing"
    },
    {
      "id": 2,
      "name": "Standard VPS",
      "slug": "standard",
      "vcpus": 2,
      "memory": 4096,
      "storage": 80,
      "bandwidth": 2048,
      "price_monthly": 10.00,
      "price_hourly": 0.015,
      "available": true,
      "locations": ["us-west", "us-east", "eu-central", "asia-pacific"],
      "description": "Ideal for web applications and small databases"
    },
    {
      "id": 3,
      "name": "Performance VPS",
      "slug": "performance",
      "vcpus": 4,
      "memory": 8192,
      "storage": 160,
      "bandwidth": 4096,
      "price_monthly": 20.00,
      "price_hourly": 0.030,
      "available": true,
      "locations": ["us-west", "us-east", "eu-central", "asia-pacific"],
      "description": "High-performance for demanding applications"
    },
    {
      "id": 4,
      "name": "Enterprise VPS",
      "slug": "enterprise",
      "vcpus": 8,
      "memory": 16384,
      "storage": 320,
      "bandwidth": 8192,
      "price_monthly": 40.00,
      "price_hourly": 0.060,
      "available": true,
      "locations": ["us-west", "us-east", "eu-central", "asia-pacific"],
      "description": "Enterprise-grade resources for mission-critical workloads"
    }
  ]
}

响应字段

外地 类型 说明说明
id integer 唯一计划标识符
name string 人类可读的计划名称
slug string URL友好型计划标识符
vcpus integer Number of virtual CPU cores
memory integer RAM in megabytes (MB)
storage integer Disk space in gigabytes (GB)
bandwidth integer Monthly data transfer in gigabytes (GB)
price_monthly decimal Monthly subscription price in USD
price_hourly decimal Hourly billing rate in USD
available boolean Whether plan is currently available for purchase
locations array List of datacenter locations where plan is available
description string Brief description of plan use case

响应状态码

200 已成功检索计划列表
401 未授权 - 身份验证令牌无效或缺失
得到 /api/v1/plans/{plan_id}/

获取计划详情

获取有关VPS具体计划的详细信息。

路径参数

参数 类型 必需的 说明说明
plan_id integer 是的 唯一计划 ID

示例请求

cURL
Python
JavaScript
curl -X GET "https://admin.vps.org/api/v1/plans/2/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
import requests

plan_id = 2
url = f"https://admin.vps.org/api/v1/plans/{plan_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
print(response.json())
const planId = 2;
const response = await fetch(`https://admin.vps.org/api/v1/plans/${planId}/`, {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

const plan = await response.json();
console.log(plan);

示例回复

{
  "id": 2,
  "name": "Standard VPS",
  "slug": "standard",
  "vcpus": 2,
  "memory": 4096,
  "storage": 80,
  "bandwidth": 2048,
  "price_monthly": 10.00,
  "price_hourly": 0.015,
  "available": true,
  "locations": ["us-west", "us-east", "eu-central", "asia-pacific"],
  "description": "Ideal for web applications and small databases",
  "features": [
    "SSD Storage",
    "99.9% Uptime SLA",
    "Free Backups",
    "24/7 Support",
    "DDoS Protection",
    "IPv6 Support"
  ],
  "recommended_for": [
    "WordPress sites with moderate traffic",
    "Small to medium web applications",
    "Development and testing environments",
    "Personal projects and portfolios"
  ]
}

响应状态码

200 Successfully retrieved plan details
401 未授权 - 身份验证令牌无效或缺失
404 未找到 - 计划不存在

定价信息信息

计费方式

VPS.org提供两种计费选项, 以满足您的需要:

月度账单
  • 固定月费,绝无隐藏费用 没有惊喜
  • 最有利于长期、生产工作量
  • 与小时计费相比,最多节省30%
  • 每个月初的帐单
  • 无隐藏收费或超额收费
按小时计费
  • 只支付您使用的小时数
  • 适合测试和短期项目
  • 按小时加薪计费
  • 以月费率为上限的最高收费上限
  • 促进发展的理念环境

包含功能

所有VPS计划包括:

  • ✓ SSD 存储
  • ✓ 99.9% 恢复时间 SLS
  • ✓ 免费每日免费备份
  • ✓ 24/7 24/7支助
  • ✓ DDoS 保护
  • ✓ IPv6 支持
  • ✓ 完全根访问
  • ✓ 抓图
  • ✓ 私营网络
  • ✓ API 访问

追加资源 追加资源

需要增加更多的资源?

选择正确的计划

快速指南

计划计划计划 最适合 典型应用案例
Starter VPS Personal projects, testing Static websites, learning environments, small blogs
Standard VPS Small businesses, web apps WordPress sites, small e-commerce, development servers
Performance VPS Medium traffic applications High-traffic WordPress, SaaS applications, databases
Enterprise VPS Large-scale applications Enterprise apps, large databases, video streaming
Need help choosing? 请联系我们的销售团队 at sales@vps.org for personalized recommendations based on your specific requirements.