Pull API
If you want us to pull your offers from your site automatically, you can use our Pull API.
Configuration
Once you've implemented the security and format as explained below, open a ticket with the link and other necessary information.Security
We recommend you use at least one of the options below to secure your Pull API:
- Only allow requests to be made from the IPs listed at https://www.serverhunter.com/spider/ips/.
- Encrypt the output with a public key, client certificate or passphrase.
- Use a non-guessable URL by adding a random token to the URL.
Format
Please use the following format:
{ "version": 1, "offers": [ { "name": "Foo","internal": "foo", "url": "http:\/\/google.com", "currency": "USD", "price": "99.99", "setup_fee": "149.99", "stock": "in_stock", "billing_interval": "monthly", "product_type": "vps", "virtualization": "kvm", "visibility": "invisible", "gpu_name": null, "cpu_type": "intel", "cpu_name": "Xeon", "cpu_amount": "1", "cpu_cores": "4", "cpu_speed": "2.66", "memory_amount": "1024", "memory_type": "ddr3", "memory_ecc": "eccreg", "hdd_amount": "2", "hdd_capacity": "4096", "ssd_amount": "2", "ssd_capacity": "512", "uplink": "100", "traffic": "512", "unmetered": [ "outbound" ], "operating_systems": [ "cloudlinux", "custom", "ubuntu", "fedora", "gentoo", "opensuse" ], "control_panel": [ "cpanel" ], "country_code": "US", "location": "New York, New York, United States of America", "coordinates": "40.7306,-73.9866", "payment_methods": [ "creditcard", "skrill", "wire" ], "features": [ "ddos", "kvm", "ipv6", "nat" ] }, { "name": "Foo", "internal": "foo", "url": "http:\/\/google.com", "currency": "USD", "price": "99.99", "setup_fee": "149.99", "stock": "in_stock", "billing_interval": "monthly", "product_type": "vps", "virtualization": "kvm", "visibility": "invisible", "gpu_name": null, "cpu_type": "intel", "cpu_name": "Xeon", "cpu_amount": "1", "cpu_cores": "4", "cpu_speed": "2.66", "memory_amount": "1024", "memory_type": "ddr3", "memory_ecc": "eccreg", "hdd_amount": "2", "hdd_capacity": "4096", "ssd_amount": "2", "ssd_capacity": "512", "uplink": "100", "traffic": "512", "unmetered": [ "outbound" ], "operating_systems": [ "cloudlinux", "custom", "ubuntu", "fedora", "gentoo", "opensuse" ], "control_panel": [ "cpanel" ], "country_code": "US", "location": "New York, New York, United States of America", "coordinates": "40.7306,-73.9866", "payment_methods": [ "creditcard", "skrill", "wire" ], "features": [ "ddos", "kvm", "ipv6", "nat" ] } ] }
For the arrays, here are the options that can be used:
[operating_systems] => Array ( [archlinux] => Arch Linux [centos] => CentOS[cloudlinux] => CloudLinux [coreos] => CoreOS [custom] => Custom ISO [debian] => Debian [ubuntu] => Ubuntu [fedora] => Fedora [freebsd] => FreeBSD [gentoo] => Gentoo [opensuse] => openSUSE [proxmox] => Proxmox [windows] => Windows [vmware] => VMware [xen] => Xen Server ) [control_panel] => Array ( [cpanel] => cPanel [directadmin] => DirectAdmin [plesk] => Plesk ) [virtualization] => Array ( [none] => None [hyperv] => Hyper-V [kvm] => KVM [lxc] => LXC [openvz] => OpenVZ [other] => Other [xen] => Xen [vmware] => VMware ) [features] => Array ( [247_support] => 24/7 Support [api] => API access [bgp] => BGP Sessions [ddos] => DDoS Protection [gpu] => Graphics Card [hwraid] => Hardware RAID [instant_setup] => Instant Setup [kvm] => KVM over IP [ipv6] => Native IPv6 [ipv6_only] => IPv6 Only [nat] => NAT IPv4 [managed] => Managed support [nvme] => NVMe SSD [phone] => Phone Support [shared_storage] => Shared Storage [ssd_cache] => SSD cached ) [payment_methods] => Array ( [alipay] => AliPay [altcoin] => Altcoins [bitcoin] => Bitcoin [creditcard] => Credit card [paypal] => PayPal [sepa] => SEPA [skrill] => Skrill [sms] => SMS [unionpay] => UnionPay [webmoney] => WebMoney [wire] => Wire transfer [westernunion] => Western Union )
Push API
If you prefer to push offers by sending HTTPS requests to our site to create, add and delete offers, use our Push API below.
Authentication
You can generate API keys by going to companies, picking your company and going to the "API" tab.
This API key can be passed in an Authorization header using either Bearer (recommended) or Basic authentication. With Bearer:
Authorization: Bearer n9lmp48mn402uard38c7jmn5qhw80t9oseznbbsuOr Basic:
Authorization: Basic bnVsbDpuOWxtcDQ4bW40MDJ1YXJkMzhjN2ptbjVxaHc4MHQ5b3Nlem5iYnN1
Output
The output will always be a JSON object with the following keys:
success
, which will either be true or falsemessage
, which will either be an error message or a success messagedata
, which will be an array with relevant output from the endpoint.
{ "success": true, "message": "All offers retrieved", "data": [] }
Available Endpoints
GET /v1/offers
Description
This endpoint will list all your offers.
Endpoint
https://api.serverhunter.com/v1/offers
Request body
This endpoint does not have a request body.
Response body
{ "success": true, "message": "All offers retrieved", "data": [ { "identifier": "291-778-A69", "is_visible": false, "is_configuration": false, "offer": { "name": "Foo", "internal": "foo", "url": "http://google.com", "currency": "USD", "price": "99.99", "setup_fee": "149.99", "stock": "in_stock", "billing_interval": "monthly", "product_type": "vps", "virtualization": "kvm", "visibility": "invisible", "gpu_name": null, "cpu_type": "intel", "cpu_name": "Xeon", "cpu_amount": "1", "cpu_cores": "4", "cpu_speed": "2.66", "memory_amount": "1024", "memory_type": "ddr3", "memory_ecc": "eccreg", "hdd_amount": "2", "hdd_capacity": "4096", "ssd_amount": "2", "ssd_capacity": "512", "uplink": "100", "traffic": "512", "unmetered": [ "outbound" ], "country_code": "US", "location": "New York, New York, United States of America", "coordinates": "40.7306,-73.9866", "payment_methods": [ "creditcard", "skrill", "wire" ], "operating_systems": [ "cloudlinux", "custom", "ubuntu", "fedora", "gentoo", "opensuse" ], "control_panel": [ "cpanel" ], "features": [ "ddos", "kvm", "ipv6", "nat" ] }, "configurations": [ { "identifier": "ACB-511-900", "is_visible": false, "is_configuration": true, "offer": { "currency": "EUR", "memory_ecc": "ecc", "visibility": "invisible" } }, { "identifier": "F43-E56-8A4", "is_visible": true, "is_configuration": true, "offer": { "name": "Bar", "unmetered": [ "inbound", "outbound" ], "visibility": "visible" } } ] } ] }
POST /v1/offers
Description
This endpoint will add an offer.
Endpoint
https://api.serverhunter.com/v1/offers
Request body
{ "name": "Foo", "internal": "foo", "url": "http:\/\/google.com", "currency": "USD", "price": "99.99", "setup_fee": "149.99", "stock": "in_stock", "billing_interval": "monthly", "product_type": "vps", "virtualization": "kvm", "visibility": "invisible", "gpu_name": null, "cpu_type": "intel", "cpu_name": "Xeon", "cpu_amount": "1", "cpu_cores": "4", "cpu_speed": "2.66", "memory_amount": "1024", "memory_type": "ddr3", "memory_ecc": "eccreg", "hdd_amount": "2", "hdd_capacity": "4096", "ssd_amount": "2", "ssd_capacity": "512", "uplink": "100", "traffic": "512", "unmetered": [ "outbound" ], "operating_systems": [ "cloudlinux", "custom", "ubuntu", "fedora", "gentoo", "opensuse" ], "control_panel": [ "cpanel" ], "country_code": "US", "location": "New York, New York, United States of America", "coordinates": "40.7306,-73.9866", "payment_methods": [ "creditcard", "skrill", "wire" ], "features": [ "ddos", "kvm", "ipv6", "nat" ] }
Response body
{ "success": true, "message": "Offer created", "data": { "identifier": "485-E21-B53", "visible": false } }
PUT /v1/offers/{OFFER_ID}
Description
This endpoint will edit an offer.
Endpoint
https://api.serverhunter.com/v1/offers/{OFFER_ID}
Request body
{ "name": "Foo", "internal": "foo", "url": "http:\/\/google.com", "currency": "USD", "price": "99.99", "setup_fee": "149.99", "stock": "in_stock", "billing_interval": "monthly", "product_type": "vps", "virtualization": "kvm", "visibility": "invisible", "gpu_name": null, "cpu_type": "intel", "cpu_name": "Xeon", "cpu_amount": "1", "cpu_cores": "4", "cpu_speed": "2.66", "memory_amount": "1024", "memory_type": "ddr3", "memory_ecc": "eccreg", "hdd_amount": "2", "hdd_capacity": "4096", "ssd_amount": "2", "ssd_capacity": "512", "uplink": "100", "traffic": "512", "unmetered": [ "outbound" ], "operating_systems": [ "cloudlinux", "custom", "ubuntu", "fedora", "gentoo", "opensuse" ], "control_panel": [ "cpanel" ], "country_code": "US", "location": "New York, New York, United States of America", "coordinates": "40.7306,-73.9866", "payment_methods": [ "creditcard", "skrill", "wire" ], "features": [ "ddos", "kvm", "ipv6", "nat" ] }
Response body
{ "success": true, "message": "Offer edited", "data": { "identifier": "485-E21-B53", "visible": false } }
DELETE /v1/offers/{OFFER_ID}
Description
This endpoint will delete an offer.
Endpoint
https://api.serverhunter.com/v1/offers/{OFFER_ID}
Request body
[]
Response body
{ "success": true, "message": "Offer deleted", "data": { "identifier": "485-E21-B53", "visible": false } }
GET /v1/offers/{OFFER_ID}
/configurations
Description
This endpoint will list all configurations for the specified offer. Replace {OFFER_ID}
with your offer identifier.
Endpoint
https://api.serverhunter.com/v1/offers/{OFFER_ID}/configurations
Request body
This endpoint does not have a request body.
Response body
{ "success": true, "message": "All configurations retrieved", "data": [ { "identifier": "ACB-511-900", "is_visible": false, "is_configuration": true, "offer": { "currency": "EUR", "memory_ecc": "ecc", "visibility": "invisible" } }, { "identifier": "F43-E56-8A4", "is_visible": true, "is_configuration": true, "offer": { "name": "Bar", "unmetered": [ "inbound", "outbound" ], "visibility": "visible" } } ] }
POST /v1/offers/{OFFER_ID}
/configurations
Description
This endpoint will create a configuration for the specified offer. Replace {OFFER_ID}
with your offer identifier.
Endpoint
https://api.serverhunter.com/v1/offers/{OFFER_ID}/configurations
Request body
{ "name": "VPS - Storage upgrade", "price": "+10", "ssd_amount": "2" }
Response body
{ "success": true, "message": "Configuration created", "data": { "identifier": "OZ7-CN2-C10", "visible": true } }