API documentation Web hosting accessible to everyone Visit LWS

Get hosting informations

GET https://api.lws.net/v1/hosting/{hosting}

operationIdgetHosting

Get detailed informations about the specified hosting. It must be managed by the user.

Path parameters

hosting string required

The domain name whose hosting informations you want to retrieve

Example: example.com

Responses

200

Hosting informations retrieved successfully

{
  "code": 200,
  "info": "Retrieved hosting info",
  "data": {
    "domain": "example.com",
    "date_purchase": "2023-01-01",
    "date_expiration": "2024-01-01",
    "ns1": "ns1.lwsdns.com",
    "ns2": "ns2.lwsdns.com",
    "ns3": "ns3.lwsdns.com",
    "ns4": "ns4.lwsdns.com",
    "owner": 547645,
    "package": "LWS Perso",
    "lws_domain": true,
    "autorenew": {
      "payment": "aucun",
      "account": ""
    }
  }
}
Response fields 16
  • code integer

    Example: 200

  • info string

    Example: Retrieved hosting info

  • data object
  • domain any

    Name of the domain

    Example: example.com

  • date_purchase any

    Purchase date of the hosting

    Example: 2023-01-01

  • date_expiration any

    Expiration date of the hosting

    Example: 2024-01-01

  • ns1 any

    First nameserver

    Example: ns1.lwsdns.com

  • ns2 any

    Second nameserver

    Example: ns2.lwsdns.com

  • ns3 any

    Third nameserver

    Example: ns3.lwsdns.com

  • ns4 any

    Fourth nameserver

    Example: ns4.lwsdns.com

  • owner any

    Owner of the hosting

    Example: 547645

  • package any

    Hosting package type

    Example: LWS Perso

  • lws_domain any

    Whether the domain has been bought at LWS.fr or not

    Example: true

  • autorenew object

    Informations about the auto renewal of the domain

  • payment string

    Example: aucun

  • account string

    Example:

314

Domain not found on the account

314 is not a registered HTTP status code. It is specific to this API.

{
  "code": 314,
  "info": "Provided domain has not been found on your account. You must own this domain to manage it."
}
Response fields 2
  • code integer

    Example: 314

  • info string

    Example: Provided domain has not been found on your account. You must own this domain to manage it.

400

Invalid input

{
  "code": 400,
  "info": "No hosting provided",
  "data": []
}
Response fields 3
  • code integer

    Example: 400

  • info string

    Example: No hosting provided

  • data any[]
401

Unauthorized - Missing authentication headers

{
  "code": 401,
  "info": "Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed."
}
Response fields 2
  • code integer

    Example: 401

  • info string

    Example: Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed.

429

Rate limit exceeded

{
  "code": 429,
  "info": "Rate limit exceeded. Please try again later."
}
Response fields 2
  • code integer

    Example: 429

  • info string

    Example: Rate limit exceeded. Please try again later.

500

Internal Server Error

{
  "code": 500,
  "info": "Internal Server Error",
  "data": "Error message"
}
Response fields 3
  • code integer

    Example: 500

  • info string

    Example: Internal Server Error

  • data string

    Example: Error message

502

Bad Gateway

{
  "code": 502,
  "info": "Invalid response from upstream server",
  "data": []
}
Response fields 3
  • code integer

    Example: 502

  • info string

    Example: Invalid response from upstream server

  • data object
Show the code examples and the test console
GET /hosting/{hosting}
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X GET \  "https://api.lws.net/v1/hosting/example.com" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS"
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/hosting/example.com");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [    "X-Auth-Login: " . $lwsAuthLogin,    "X-Auth-Pass: " . $lwsAuthPass,]);$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.get(    "https://api.lws.net/v1/hosting/example.com",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/hosting/example.com", {  method: "GET",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,  },});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"req, _ := http.NewRequest("GET",    "https://api.lws.net/v1/hosting/example.com", nil)req.Header.Set("X-Auth-Login", lwsAuthLogin)req.Header.Set("X-Auth-Pass", lwsAuthPass)resp, err := http.DefaultClient.Do(req)