Hostinger API
Overview
The Hostinger API provides a comprehensive set of endpoints that allow developers to interact with Hostinger's services programmatically. This API enables you to manage various aspects of your Hostinger account.
The Hostinger API is a (mostly) RESTful API that uses standard HTTP methods and status codes.
Authentication
The Hostinger API uses tokens for authentication. To authenticate your requests, you need to include a valid bearer token in the Authorization header of your HTTP requests:
Authorization: Bearer YOUR_API_TOKEN
API tokens for individual users can be created and managed from the Account page of the Hostinger Panel. Tokens will have same permissions as the owning user. Optionally, tokens can be set to expire after a certain period of time.
Rate Limiting
To ensure fair usage and prevent abuse, the API enforces rate limits on the number of requests that can be made within a certain time period. If you exceed the rate limit, you will receive a 429 Too Many Requests response. Rate limit headers are included in the response to help you manage your requests. Your IP address might get temporarily blocked if you exceed the rate limit multiple times.
Parameters
All requests sent to API must have the content type application/json.
POST, PUT, PATCH methods may include a JSON object in the request body.
Documentation provides required structure and examples of the object.
Some endpoints require path parameters.
These parameters are included in the URL path and are marked with curly braces.
Pagination
Some endpoints return a large number of items. To make these responses more manageable, the API uses pagination. By default, the API returns50 items per page.
The page number can be specified using the page query parameter,
for example: /api/vps/v1/public-keys?page=2
Errors
The Hostinger API uses standard HTTP status codes to indicate the success or failure of a request.
In case of an error, the API will return a JSON response with an error field,
containing a human-readable error message.
Error responses also contain a correlation_id field
which can be used to identify the request in case you need to contact support.
SDKs & Tools
To help you get started with the Hostinger API,we provide SDKs and tools in various programming languages. The usage & documentation for each SDK can be found in the respective repositories:
- Ansible - https://github.com/hostinger/ansible-collection-hostinger
- CLI - https://github.com/hostinger/api-cli
- n8n node - https://github.com/hostinger/api-n8n-node
- MCP server - https://github.com/hostinger/api-mcp-server
- PHP - https://github.com/hostinger/api-php-sdk
- Python - https://github.com/hostinger/api-python-sdk
- Terraform - https://github.com/hostinger/terraform-provider-hostinger
- Node / TypeScript - https://github.com/hostinger/api-typescript-sdk
- Postman collection - https://www.postman.com/hostinger-api
- WHMCS module - https://github.com/hostinger/api-whmcs-plugin
Change log
For information on the latest changes to the API, please refer to the change log.
Support
If you have any questions, feedback or feature requests, please create an issue or discussion on the repository.
For any support take a look at our Github Repository, dedicated to the Hostinger API.
Install official CLI tool. Examples and usage instructions can be found in our Github repository.
hostinger vps vm list