|
| 1 | +--- |
| 2 | +title: "1.x.x" |
| 3 | +--- |
| 4 | + |
| 5 | +import HttpMethod from "@site/src/components/httpMethod"; |
| 6 | +import HttpCode from "@site/src/components/httpCode"; |
| 7 | + |
| 8 | +# WeatherStack Core Internal API 1.x.x |
| 9 | +:::note |
| 10 | +The majority of the API routes found on this page are designed to be used within C or C++ programs, |
| 11 | +so they may not return data that can be easily interpreted by languages such as JavaScript. |
| 12 | + |
| 13 | +The API routes on this page **do not follow the default API guidelines** as they are internal API |
| 14 | +routes. This means that by default, these API routes are **insecure, and should not be publicly |
| 15 | +exposed**. |
| 16 | + |
| 17 | +For more information on how to secure this internal endpoint for public exposure, please [follow |
| 18 | +this guide](/docs/apis/core_internal_api/securing/). |
| 19 | +::: |
| 20 | + |
| 21 | +:::danger |
| 22 | +Exposing this endpoint without securing it is dangerous, and leaves a security vulnerability. |
| 23 | +::: |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +<HttpMethod method="GET" /> <a id="root" href="#root">`/`</a> |
| 28 | + |
| 29 | +<br /><br /> |
| 30 | + |
| 31 | +**Description:** |
| 32 | +This API route is simply to return a small JSON object, telling you some basic information as to |
| 33 | +what is running on that port. |
| 34 | + |
| 35 | +<details> |
| 36 | + <summary> |
| 37 | + <HttpCode code="200" /> |
| 38 | + </summary> |
| 39 | + |
| 40 | + ```json |
| 41 | + { |
| 42 | + "success": true, |
| 43 | + "code": 200, |
| 44 | + |
| 45 | + "message": "Number 5 is alive!", |
| 46 | + |
| 47 | + "version": "1.0.0", // Current version |
| 48 | + "name": "WeatherStack Core Internal API", // Name (Makes it easier to look it up) |
| 49 | + "repository": "https://github.com/WeatherStack/Core" // Repository link |
| 50 | + } |
| 51 | + ``` |
| 52 | +</details> |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +<HttpMethod method="GET" /> <a id="health-liveliness" href="#health-liveliness">`/v1/health/liveliness`</a> |
| 57 | + |
| 58 | +<br /><br /> |
| 59 | + |
| 60 | +**Description:** |
| 61 | +Only returns status 200 if everything is good, and working correctly and as expected. |
| 62 | + |
| 63 | +<details> |
| 64 | + <summary> |
| 65 | + <HttpCode code="200" /> |
| 66 | + </summary> |
| 67 | + |
| 68 | + No content. |
| 69 | +</details> |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +<HttpMethod method="GET" /> <a id="health-info" href="#health-info">`/v1/health/info`</a> |
| 74 | + |
| 75 | +<br /><br /> |
| 76 | + |
| 77 | +**Description:** |
| 78 | +This API route gives more in-depth information, such as uptime. |
| 79 | + |
| 80 | +<details> |
| 81 | + <summary> |
| 82 | + <HttpCode code="200" /> |
| 83 | + </summary> |
| 84 | + |
| 85 | + ```json |
| 86 | + { |
| 87 | + "success": true, |
| 88 | + "code": 200, |
| 89 | + |
| 90 | + "message": "Dude, you can't run from the future!", |
| 91 | + |
| 92 | + "stats": { |
| 93 | + "uptime": 3538688.83811651, |
| 94 | + "uptime_human": "1 months 10 days 12 hours 24 minutes 32 seconds 838 milliseconds" |
| 95 | + } |
| 96 | + } |
| 97 | + ``` |
| 98 | +</details> |
0 commit comments