ricardoneud.com/api
最新稳定版本:v1.1.0
Composer 安装命令:
composer require ricardoneud.com/api
包简介
Official SDK for the API from Ricardoneud.com, fully compatible with all PHP environments
README 文档
README
This guide explains how to use the official Composer module to interact with the API. It covers installation, setup, authentication, and using the main modules such as games, tools, reseller, and user management.
⚠️ Important: Always verify which endpoints are available in which version. Not all endpoints exist in every version, and some features are only available from v3 and above. Make sure your project uses a supported API version.
Installation
composer require ricardoneud.com/api
Initialization
The client can be initialized with either an API Key, a Secret token, and optionally a custom URL:
<?php require 'vendor/autoload.php'; use Ricardoneud\API\RicardoneudAPI; $api = new RicardoNeudAPI([ 'apiKey' => 'your-api-key', // OR use 'secret' => 'your-secret' 'version' => 'v4' ]);
Changing Base URL
You can change the API endpoint at runtime using setURL:
$api->setURL('https://sandbox.api.ricardoneud.com'); // Switch to sandbox environment
Changing Version
$api->setVersion('v4'); // Verify which endpoints are supported in v4
Authentication
API Key
- Log in at Ricardoneud.com
- Go to Dashboard → API Keys
- Click Create API Key, configure permissions, and set environment to
Production. - Use the API Key in your client:
$api->setApiKey('your-api-key');
Secret Token (Login-based)
Short-lived tokens provide session-based access (valid for 24 hours).
$loginResponse = $api->user->login('usernameOrEmail', 'password', true); echo $loginResponse['secret']; // Use this token in subsequent requests
$api = new RicardoNeudAPI(['secret' => 'your-secret']);
You can revoke tokens when needed:
$api->user->revokeSecret('usernameOrEmail', 'password', 'your-secret');
Core Modules
Games
$server = $api->games->minecraft('play.hypixel.net'); $fivemServer = $api->games->fivem('127.0.0.1', '30120');
Tools
$dns = $api->tools->dnsCheck('example.com', 'A'); $domain = $api->tools->domainCheck('google.com'); $subdomains = $api->tools->subdomainFinder('example.com'); $geoip = $api->tools->geoIP('8.8.8.8');
Mail verification:
$mail = $api->tools->mailCheck('example.com', 'selector'); $mailHost = $api->tools->mailHostCheck('example.com');
Reseller
$api->reseller->checkLicense('LICENSE_KEY'); $api->reseller->generateLicense([ 'registeredTo' => 'John Doe', 'domainOrIp' => 'example.com', 'status' => 'active', 'productId' => 123, 'projectId' => 456 ]); $api->reseller->updateLicense('LICENSE_KEY', ['status' => 'inactive']); $api->reseller->deleteLicense('LICENSE_KEY');
User
$loginResponse = $api->user->login('usernameOrEmail', 'password', true); $api->user->revokeSecret('usernameOrEmail', 'password', 'secret-token');
OAuth2
$token = $api->oauth2->getAccessToken('code', 'redirectUri', 'clientId', 'clientSecret'); $profile = $api->oauth2->getProfile($token['access_token']);
Request Handling
All HTTP requests are handled internally with Guzzle, including error handling. Every method returns an array of the response.
try { $result = $api->tools->geoIP('8.8.8.8'); print_r($result); } catch (\Exception $error) { echo $error->getCode() . ' ' . $error->getMessage(); }
Notes
- You must provide either an API Key or a Secret token.
- Secret tokens expire after 24 hours and are visible in your dashboard.
- API Key and Secret are mutually exclusive; setting one clears the other.
- You can optionally provide a custom
baseURLat initialization. If omitted, the SDK defaults tohttps://api.ricardoneud.com. - The
setURLmethod allows switching API domains at runtime (e.g., sandbox). - Always check the supported API version to ensure endpoint compatibility.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-05