Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

HTTP API

Richard Bunt edited this page Feb 15, 2014 · 5 revisions

Data can be collected from KSP by using any HTTP client to make a request to the appropriate URL. The following example demonstrates how to construct such URL.

http://<ip-address>:<port>/telemachus/datalink?a=**v.alt**

The portion of the API call in bold is known as the API string and is used to identify values or functions within KSP. These API strings can be chained together using the & character, an example is shown below.

http://<ip-address>:<port>/telemachus/datalink?**a**=v.alt&**b**=v.missionTime

The above example will return the corresponding altitude and mission time values from KSP as a JSON formatted string. The attribute names in the returned JSON will match the identifiers (marked in bold) before the assignment character. An example of the returned data is given below.

{"a":94644.1533377647,"b":266.080000005793}

If an API string does not exist, then an internal server error page will be returned instead.

Available API Strings

The API strings which are currently supported can be discovered by reading the DataLinkHandlers source file.

Clone this wiki locally