1+ {
2+ "openapi" : " 3.0.3" ,
3+ "info" : {
4+ "title" : " Site Informant Public API" ,
5+ "version" : " 1.0.0" ,
6+ "description" : " Read-only endpoints that expose website uptime status, SSL expiration info, and public plan details for Site Informant." ,
7+ "contact" : {
8+ "name" : " Site Informant Support" ,
9+ "email" : " informant@siteinformant.com" ,
10+ "url" : " https://siteinformant.com"
11+ },
12+ "termsOfService" : " https://siteinformant.com/terms" ,
13+ "license" : {
14+ "name" : " Proprietary" ,
15+ "url" : " https://siteinformant.com"
16+ }
17+ },
18+ "servers" : [
19+ {
20+ "url" : " https://api.siteinformant.com" ,
21+ "description" : " Production"
22+ },
23+ {
24+ "url" : " http://localhost:5000" ,
25+ "description" : " Local"
26+ }
27+ ],
28+ "externalDocs" : {
29+ "description" : " Website & docs" ,
30+ "url" : " https://siteinformant.com"
31+ },
32+ "tags" : [
33+ {
34+ "name" : " Public" ,
35+ "description" : " Public, anonymous, read-only endpoints. Privacy is respected via per-site opt-in."
36+ }
37+ ],
38+ "paths" : {
39+ "/api/public/status/{domain}" : {
40+ "get" : {
41+ "tags" : [ " Public" ],
42+ "summary" : " Get public status for a monitored domain" ,
43+ "description" : " Returns uptime percentage calculated from recent checks, current online/offline state, average response time, and SSL certificate details (if applicable). Only domains explicitly opted-in by the site owner are returned." ,
44+ "parameters" : [
45+ {
46+ "name" : " domain" ,
47+ "in" : " path" ,
48+ "required" : true ,
49+ "schema" : {
50+ "type" : " string" ,
51+ "example" : " example.com"
52+ },
53+ "description" : " Domain without scheme. If a full URL is provided, the host is extracted."
54+ }
55+ ],
56+ "responses" : {
57+ "200" : {
58+ "description" : " Status for the requested domain." ,
59+ "headers" : {
60+ "Cache-Control" : {
61+ "description" : " Clients may cache this response for a short period." ,
62+ "schema" : {
63+ "type" : " string" ,
64+ "example" : " public, max-age=30"
65+ }
66+ }
67+ },
68+ "content" : {
69+ "application/json" : {
70+ "schema" : { "$ref" : " #/components/schemas/PublicStatusResponse" },
71+ "examples" : {
72+ "ok" : {
73+ "summary" : " Typical response" ,
74+ "value" : {
75+ "domain" : " example.com" ,
76+ "uptimePercent" : 99.92 ,
77+ "isOnline" : true ,
78+ "lastCheckUtc" : " 2025-11-03T07:45:00Z" ,
79+ "averageResponseMs" : 238 ,
80+ "sslExpiresUtc" : " 2026-01-04T00:00:00Z" ,
81+ "sslIssuer" : " Let's Encrypt"
82+ }
83+ }
84+ }
85+ }
86+ }
87+ },
88+ "404" : {
89+ "description" : " Domain not found or not public." ,
90+ "content" : {
91+ "application/json" : {
92+ "schema" : { "$ref" : " #/components/schemas/ErrorResponse" },
93+ "examples" : { "notPublic" : { "value" : { "error" : " Not found or not public." } } }
94+ }
95+ }
96+ },
97+ "400" : {
98+ "description" : " Invalid input." ,
99+ "content" : {
100+ "application/json" : {
101+ "schema" : { "$ref" : " #/components/schemas/ErrorResponse" },
102+ "examples" : { "bad" : { "value" : { "error" : " Domain is required." } } }
103+ }
104+ }
105+ }
106+ }
107+ }
108+ },
109+ "/api/public/plans" : {
110+ "get" : {
111+ "tags" : [ " Public" ],
112+ "summary" : " List public pricing plans" ,
113+ "description" : " Returns the current public plans, their monthly price, and included site counts." ,
114+ "responses" : {
115+ "200" : {
116+ "description" : " Plan list." ,
117+ "headers" : {
118+ "Cache-Control" : {
119+ "description" : " Clients may cache the plan list." ,
120+ "schema" : {
121+ "type" : " string" ,
122+ "example" : " public, max-age=3600"
123+ }
124+ }
125+ },
126+ "content" : {
127+ "application/json" : {
128+ "schema" : { "$ref" : " #/components/schemas/PublicPlansResponse" },
129+ "examples" : {
130+ "plans" : {
131+ "value" : {
132+ "plans" : [
133+ {
134+ "name" : " Free" ,
135+ "monthlyPrice" : 0.0 ,
136+ "includedSites" : 1 ,
137+ "notes" : " 1 site free."
138+ },
139+ {
140+ "name" : " Pay-As-You-Go" ,
141+ "monthlyPrice" : 1.0 ,
142+ "includedSites" : 5 ,
143+ "notes" : " 5-site blocks."
144+ },
145+ {
146+ "name" : " Professional" ,
147+ "monthlyPrice" : 9.99 ,
148+ "includedSites" : 75 ,
149+ "notes" : " Great for teams."
150+ },
151+ {
152+ "name" : " Enterprise" ,
153+ "monthlyPrice" : 29.99 ,
154+ "includedSites" : 200 ,
155+ "notes" : " Agencies & large portfolios."
156+ }
157+ ]
158+ }
159+ }
160+ }
161+ }
162+ }
163+ }
164+ }
165+ }
166+ },
167+ "/api/public/example" : {
168+ "get" : {
169+ "tags" : [ " Public" ],
170+ "summary" : " Sample status payload" ,
171+ "description" : " Provides a representative status response for testing and quick integration checks." ,
172+ "responses" : {
173+ "200" : {
174+ "description" : " Example status payload." ,
175+ "headers" : {
176+ "Cache-Control" : {
177+ "description" : " Clients may cache this example payload." ,
178+ "schema" : {
179+ "type" : " string" ,
180+ "example" : " public, max-age=300"
181+ }
182+ }
183+ },
184+ "content" : {
185+ "application/json" : {
186+ "schema" : { "$ref" : " #/components/schemas/PublicStatusResponse" }
187+ }
188+ }
189+ }
190+ }
191+ }
192+ }
193+ },
194+ "components" : {
195+ "schemas" : {
196+ "PublicStatusResponse" : {
197+ "type" : " object" ,
198+ "description" : " Public view of recent availability and certificate data for a domain." ,
199+ "properties" : {
200+ "domain" : {
201+ "type" : " string" ,
202+ "description" : " Normalized domain (host)."
203+ },
204+ "uptimePercent" : {
205+ "type" : " number" ,
206+ "format" : " double" ,
207+ "description" : " Percentage of successful checks across recent samples (0–100)."
208+ },
209+ "isOnline" : {
210+ "type" : " boolean" ,
211+ "description" : " Latest check result."
212+ },
213+ "lastCheckUtc" : {
214+ "type" : " string" ,
215+ "format" : " date-time" ,
216+ "nullable" : true ,
217+ "description" : " Timestamp of the most recent check in UTC (null if unavailable)."
218+ },
219+ "averageResponseMs" : {
220+ "type" : " integer" ,
221+ "nullable" : true ,
222+ "description" : " Average response time (ms) across recent samples, excluding zeros (null if unavailable)."
223+ },
224+ "sslExpiresUtc" : {
225+ "type" : " string" ,
226+ "format" : " date-time" ,
227+ "nullable" : true ,
228+ "description" : " SSL certificate expiration in UTC (null if not HTTPS or unknown)."
229+ },
230+ "sslIssuer" : {
231+ "type" : " string" ,
232+ "nullable" : true ,
233+ "description" : " Certificate issuer if known."
234+ }
235+ },
236+ "required" : [ " domain" , " uptimePercent" , " isOnline" ]
237+ },
238+ "PublicPlansResponse" : {
239+ "type" : " object" ,
240+ "properties" : {
241+ "plans" : {
242+ "type" : " array" ,
243+ "items" : { "$ref" : " #/components/schemas/PublicPlan" },
244+ "description" : " Available public plans."
245+ }
246+ },
247+ "required" : [ " plans" ]
248+ },
249+ "PublicPlan" : {
250+ "type" : " object" ,
251+ "properties" : {
252+ "name" : {
253+ "type" : " string" ,
254+ "description" : " Plan name."
255+ },
256+ "monthlyPrice" : {
257+ "type" : " number" ,
258+ "format" : " double" ,
259+ "description" : " USD monthly price."
260+ },
261+ "includedSites" : {
262+ "type" : " integer" ,
263+ "description" : " Included site count."
264+ },
265+ "notes" : {
266+ "type" : " string" ,
267+ "nullable" : true ,
268+ "description" : " Short description."
269+ }
270+ },
271+ "required" : [ " name" , " monthlyPrice" , " includedSites" ]
272+ },
273+ "ErrorResponse" : {
274+ "type" : " object" ,
275+ "properties" : {
276+ "error" : {
277+ "type" : " string" ,
278+ "description" : " Short error message."
279+ }
280+ },
281+ "required" : [ " error" ]
282+ }
283+ }
284+ }
285+ }
0 commit comments