-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathapi-spec.yaml
More file actions
2177 lines (2028 loc) · 78.1 KB
/
api-spec.yaml
File metadata and controls
2177 lines (2028 loc) · 78.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: ChangeDetection.io API
description: |
# ChangeDetection.io Web page monitoring and notifications API
REST API for managing Page watches, Group tags, and Notifications.
changedetection.io can be driven by its built in simple API, in the examples below you will also find `curl` command line and `python` examples to help you get started faster.
## Where to find my API key?
The API key can be easily found under the **SETTINGS** then **API** tab of changedetection.io dashboard.
Simply click the API key to automatically copy it to your clipboard.

## Connection URL
The API can be found at `/api/v1/`, so for example if you run changedetection.io locally on port 5000, then URL would be `http://localhost:5000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091/history`.
If you are using the hosted/subscription version of changedetection.io, then the URL is based on your login URL, for example:
`https://<your login url>/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091/history`
## Authentication
Almost all API requests require some authentication, this is provided as an **API Key** in the header of the HTTP request.
For example: `x-api-key: YOUR_API_KEY`
version: 0.1.7
contact:
name: ChangeDetection.io
url: https://github.com/dgtlmoon/changedetection.io
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: http://localhost:5000/api/v1
description: Development server
- url: https://yourdomain.com/api/v1
description: Production server
- url: '{protocol}://{host}/api/v1'
description: Custom server
variables:
protocol:
enum:
- http
- https
default: https
host:
default: yourdomain.com
description: Your changedetection.io host
security:
- ApiKeyAuth: []
tags:
- name: Watch Management
description: |
Core functionality for managing web page monitors. Create, retrieve, update, and delete individual watches.
Each watch represents a single URL being monitored for changes, with configurable settings for check intervals,
notification preferences, and content filtering options.
- name: Watch History
description: |
Get a list of timestamps of all changes detected for a watch.
- name: Snapshots
description: |
Retrieve individual text snapshot of monitored content according to the `timestamp`. The text snapshot is the HTML
to Text at page check time.
Set the query argument `html` to any value to retrieve the last HTML fetched, the system only keeps the last two
(2) HTML files fetched.
Use the Watch History API endpoint to get a list of timestamps to pass to this query.
- name: Favicon
description: |
Retrieve favicon images associated with monitored web pages. These are used in the dashboard interface
to visually identify different watches in your monitoring list.
- name: Group / Tag Management
description: |
Organize your watches using tags and groups. Tags (also known as Groups) allow you to categorize monitors, set group-wide
notification preferences, and perform bulk operations like mass rechecking or status changes across
multiple related watches.
- name: Notifications
description: |
Configure global notification endpoints that can be used across all your watches. Supports various
notification services including email, Discord, Slack, webhooks, and many other popular platforms.
These settings serve as defaults that can be overridden at the individual watch or tag level.
The notification syntax uses [https://github.com/caronc/apprise](https://github.com/caronc/apprise).
- name: Search
description: |
Search and filter your watches by URL patterns, titles, or tags. Useful for quickly finding specific
monitors in large collections or identifying watches that match certain criteria.
- name: Import
description: |
Bulk import multiple URLs for monitoring. Accepts plain text lists of URLs and can automatically
apply tags, proxy settings, and other configurations to all imported watches simultaneously.
- name: System Information
description: |
Retrieve system status and statistics about your changedetection.io instance, including total watch
counts, uptime information, and version details.
- name: Plugin API Extensions
description: |
## How Processor Plugins Extend the API
changedetection.io uses a **processor plugin** system to handle different types of change detection.
Each processor lives in `changedetectionio/processors/<name>/` and may include an `api.yaml` file
that extends the core Watch schema with processor-specific configuration fields.
### How it works
At startup, changedetection.io scans all installed processors for an `api.yaml` file. Any schemas
and code samples defined there are deep-merged into the live API specification, making the
processor's configuration fields valid on all watch create and update requests.
The live, fully-merged spec is always available at `/api/v1/full-spec` — use that URL with
Swagger UI or Redoc to see the complete schema for your specific installation.
---
### Writing a processor `api.yaml`
Place an `api.yaml` in the processor plugin's own directory, alongside its `__init__.py`
(e.g. `changedetectionio/processors/my_processor/api.yaml`). The schema name **must** follow the
convention `processor_config_<processor_name>` (e.g. `processor_config_restock_diff`). That same
key is used as the JSON field name when creating or updating a watch.
A minimal `api.yaml` for a hypothetical `my_processor`:
```yaml
components:
schemas:
processor_config_my_processor:
type: object
description: Configuration for my_processor
properties:
some_option:
type: boolean
default: true
description: Enable some behaviour
paths:
/watch:
post:
x-code-samples:
- lang: curl
label: my_processor example
source: |
curl -X POST "http://localhost:5000/api/v1/watch" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"processor": "my_processor",
"processor_config_my_processor": { "some_option": true }
}'
```
The `paths` section in `api.yaml` is used only for injecting additional `x-code-samples` into
existing endpoints — you cannot define new routes via plugin.
---
### Built-in plugin: `restock_diff`
The `restock_diff` processor is always shipped with changedetection.io. It monitors product
availability and price changes using structured data (JSON-LD / schema.org microdata) and
text heuristics. It is activated by setting `"processor": "restock_diff"` on a watch.
It adds the `processor_config_restock_diff` block to the Watch schema with these fields:
| Field | Type | Default | Description |
|---|---|---|---|
| `in_stock_processing` | string | `in_stock_only` | `in_stock_only` — only alert Out-of-Stock→In-Stock · `all_changes` — alert any availability change · `off` — disable stock tracking |
| `follow_price_changes` | boolean | `true` | Monitor and alert on price changes |
| `price_change_min` | number\|null | — | Alert when price drops **below** this value |
| `price_change_max` | number\|null | — | Alert when price rises **above** this value |
| `price_change_threshold_percent` | number\|null | — | Minimum % change since the original price to trigger an alert |
#### CREATE — Add a restock/price monitor
```bash
curl -X POST "http://localhost:5000/api/v1/watch" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/product/widget",
"processor": "restock_diff",
"processor_config_restock_diff": {
"in_stock_processing": "in_stock_only",
"follow_price_changes": true,
"price_change_threshold_percent": 5
}
}'
```
#### READ — Retrieve the monitor
The response JSON includes `processor_config_restock_diff` alongside all standard watch fields:
```bash
curl -X GET "http://localhost:5000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091" \
-H "x-api-key: YOUR_API_KEY"
```
```json
{
"uuid": "cc0cfffa-f449-477b-83ea-0caafd1dc091",
"url": "https://example.com/product/widget",
"processor": "restock_diff",
"processor_config_restock_diff": {
"in_stock_processing": "in_stock_only",
"follow_price_changes": true,
"price_change_threshold_percent": 5,
"price_change_min": null,
"price_change_max": null
}
}
```
#### UPDATE — Change thresholds without recreating the monitor
Only fields included in the request body are updated; omitted fields are left unchanged.
```bash
curl -X PUT "http://localhost:5000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"processor_config_restock_diff": {
"in_stock_processing": "all_changes",
"follow_price_changes": true,
"price_change_min": 10.00,
"price_change_max": 500.00
}
}'
```
#### DELETE — Remove the monitor
```bash
curl -X DELETE "http://localhost:5000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091" \
-H "x-api-key: YOUR_API_KEY"
```
---
For the complete schema-validated documentation including all processor fields, fetch the live spec
and load it into Swagger UI or Redoc:
```
GET /api/v1/full-spec
```
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: x-api-key
description: |
API key for authentication. You can find your API key in the changedetection.io dashboard under Settings > API.
Enter your API key in the "Authorize" button above to automatically populate all code examples.
schemas:
WatchBase:
type: object
properties:
uuid:
type: string
format: uuid
description: Unique identifier
readOnly: true
date_created:
type: [integer, 'null']
description: Unix timestamp of creation
readOnly: true
url:
type: string
format: uri
description: URL to monitor for changes
maxLength: 5000
title:
type: [string, 'null']
description: Custom title for the web page change monitor (watch), not to be confused with page_title
maxLength: 5000
tag:
type: string
description: Tag UUID to associate with this web page change monitor (watch)
maxLength: 5000
tags:
type: array
items:
type: string
description: Array of tag UUIDs
paused:
type: boolean
description: Whether the web page change monitor (watch) is paused
notification_muted:
type: boolean
description: Whether notifications are muted
method:
type: string
enum: [GET, POST, DELETE, PUT]
description: HTTP method to use
fetch_backend:
type: string
description: |
Backend to use for fetching content. Common values:
- `system` (default) - Use the system-wide default fetcher
- `html_requests` - Fast requests-based fetcher
- `html_webdriver` - Browser-based fetcher (Playwright/Puppeteer)
- `extra_browser_*` - Custom browser configurations (if configured)
- Plugin-provided fetchers (if installed)
pattern: '^(system|html_requests|html_webdriver|extra_browser_.+)$'
default: system
headers:
type: object
additionalProperties:
type: string
description: HTTP headers to include in requests
body:
type: [string, 'null']
description: HTTP request body
maxLength: 5000
proxy:
type: [string, 'null']
description: Proxy configuration
maxLength: 5000
ignore_status_codes:
type: [boolean, 'null']
description: Ignore HTTP status code errors (boolean or null)
webdriver_delay:
type: [integer, 'null']
description: Delay in seconds for webdriver
webdriver_js_execute_code:
type: [string, 'null']
description: JavaScript code to execute
maxLength: 5000
time_between_check:
type: object
properties:
weeks:
type: [integer, 'null']
minimum: 0
maximum: 52000
days:
type: [integer, 'null']
minimum: 0
maximum: 365000
hours:
type: [integer, 'null']
minimum: 0
maximum: 8760000
minutes:
type: [integer, 'null']
minimum: 0
maximum: 525600000
seconds:
type: [integer, 'null']
minimum: 0
maximum: 31536000000
description: Time intervals between checks. All fields must be non-negative. At least one non-zero value required when not using default settings.
time_between_check_use_default:
type: boolean
default: true
description: Whether to use global settings for time between checks - defaults to true if not set
notification_urls:
type: array
items:
type: string
maxLength: 1000
maxItems: 100
description: Notification URLs for this web page change monitor (watch). Maximum 100 URLs.
notification_title:
type: [string, 'null']
description: Custom notification title
maxLength: 5000
notification_body:
type: [string, 'null']
description: Custom notification body
maxLength: 5000
notification_format:
type: string
enum: ['text', 'html', 'htmlcolor', 'markdown', 'System default']
description: Format for notifications
track_ldjson_price_data:
type: [boolean, 'null']
description: Whether to track JSON-LD price data
browser_steps:
type: array
items:
type: object
properties:
operation:
type: [string, 'null']
maxLength: 5000
selector:
type: [string, 'null']
maxLength: 5000
optional_value:
type: [string, 'null']
maxLength: 5000
required: [operation, selector, optional_value]
additionalProperties: false
maxItems: 100
description: Browser automation steps. Maximum 100 steps allowed.
processor:
type: string
enum: [restock_diff, text_json_diff]
default: text_json_diff
description: Optional processor mode to use for change detection. Defaults to `text_json_diff` if not specified.
# Content Filtering
include_filters:
type: array
items:
type: string
maxLength: 5000
maxItems: 100
description: CSS/XPath selectors to extract specific content from the page
subtractive_selectors:
type: array
items:
type: string
maxLength: 5000
maxItems: 100
description: CSS/XPath selectors to remove content from the page
ignore_text:
type: array
items:
type: string
maxLength: 5000
maxItems: 100
description: Text patterns to ignore in change detection
trigger_text:
type: array
items:
type: string
maxLength: 5000
maxItems: 100
description: Text/regex patterns that must be present to trigger a change
text_should_not_be_present:
type: array
items:
type: string
maxLength: 5000
maxItems: 100
description: Text that should NOT be present (triggers alert if found)
extract_lines_containing:
type: array
items:
type: string
maxLength: 5000
maxItems: 100
description: Keep only lines containing these substrings (plain text, case-insensitive) — simpler alternative to regex
extract_text:
type: array
items:
type: string
maxLength: 5000
maxItems: 100
description: Regex patterns to extract specific text after filtering
# Text Processing
trim_text_whitespace:
type: boolean
default: false
description: Strip leading/trailing whitespace from text
sort_text_alphabetically:
type: boolean
default: false
description: Sort lines alphabetically before comparison
remove_duplicate_lines:
type: boolean
default: false
description: Remove duplicate lines from content
check_unique_lines:
type: boolean
default: false
description: Compare against all history for unique lines
strip_ignored_lines:
type: [boolean, 'null']
description: Remove lines matching ignore patterns
# Change Detection Filters
filter_text_added:
type: boolean
default: true
description: Include added text in change detection
filter_text_removed:
type: boolean
default: true
description: Include removed text in change detection
filter_text_replaced:
type: boolean
default: true
description: Include replaced text in change detection
# Restock/Price Detection
in_stock_only:
type: boolean
default: true
description: Only trigger on in-stock transitions (restock_diff processor)
follow_price_changes:
type: boolean
default: true
description: Monitor and track price changes (restock_diff processor)
price_change_threshold_percent:
type: [number, 'null']
description: Minimum price change percentage to trigger notification
has_ldjson_price_data:
type: [boolean, 'null']
description: Whether page has LD-JSON price data (auto-detected)
readOnly: true
# Notifications
notification_screenshot:
type: boolean
default: false
description: Include screenshot in notifications (if supported by notification URL)
filter_failure_notification_send:
type: boolean
default: true
description: Send notification when filters fail to match content
# History & Display
use_page_title_in_list:
type: [boolean, 'null']
description: Display page title in watch list (null = use system default)
history_snapshot_max_length:
type: [integer, 'null']
minimum: 1
maximum: 1000
description: Maximum number of history snapshots to keep (null = use system default)
# Scheduling
time_schedule_limit:
type: object
description: Weekly schedule limiting when checks can run
properties:
enabled:
type: boolean
default: false
monday:
$ref: '#/components/schemas/DaySchedule'
tuesday:
$ref: '#/components/schemas/DaySchedule'
wednesday:
$ref: '#/components/schemas/DaySchedule'
thursday:
$ref: '#/components/schemas/DaySchedule'
friday:
$ref: '#/components/schemas/DaySchedule'
saturday:
$ref: '#/components/schemas/DaySchedule'
sunday:
$ref: '#/components/schemas/DaySchedule'
# Conditions (advanced logic)
conditions:
type: array
items:
type: object
properties:
field:
type: string
description: Field to check (e.g., 'page_filtered_text', 'page_title')
operator:
type: string
description: Comparison operator (e.g., 'contains_regex', 'equals', 'not_equals')
value:
type: string
description: Value to compare against
required: [field, operator, value]
maxItems: 100
description: Array of condition rules for change detection logic (empty array when not set)
conditions_match_logic:
type: string
enum: ['ALL', 'ANY']
default: 'ALL'
description: Logic operator - ALL (match all conditions) or ANY (match any condition)
# AI / LLM
llm_intent:
type: string
maxLength: 2000
default: ''
description: Plain-English intent for AI-based change filtering. The AI evaluates every detected change against this and only notifies when it matches.
llm_change_summary:
type: string
maxLength: 2000
default: ''
description: Instructions for the AI to summarise changes in notifications. When set, replaces {{diff}} with a human-readable description.
llm_prefilter:
type: [string, 'null']
readOnly: true
description: CSS selector derived by the AI to narrow content scope before evaluation (auto-managed, do not set manually).
llm_evaluation_cache:
type: object
readOnly: true
description: Internal cache of AI evaluation results keyed by (intent, diff) hash (auto-managed).
llm_last_tokens_used:
type: [integer, 'null']
readOnly: true
description: Number of tokens consumed by the AI on the most recent check.
llm_tokens_used_cumulative:
type: [integer, 'null']
readOnly: true
description: Total tokens consumed by the AI across all checks for this watch.
DaySchedule:
type: object
properties:
enabled:
type: boolean
default: true
start_time:
type: string
pattern: '^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$'
default: '00:00'
description: Start time in HH:MM format
duration:
type: object
properties:
hours:
type: string
pattern: '^[0-9]+$'
default: '24'
minutes:
type: string
pattern: '^[0-9]+$'
default: '00'
Watch:
allOf:
- $ref: '#/components/schemas/WatchBase'
- type: object
properties:
last_checked:
type: integer
description: Unix timestamp of last check
readOnly: true
last_changed:
type: integer
description: Unix timestamp of last change
readOnly: true
x-computed: true
last_error:
type: [string, boolean, 'null']
description: Last error message (false when no error, string when error occurred, null if not checked yet)
readOnly: true
last_viewed:
type: integer
description: Unix timestamp in seconds of the last time the watch was viewed. Setting it to a value higher than `last_changed` in the "Update watch" endpoint marks the watch as viewed.
minimum: 0
link:
type: string
format: string
description: The watch URL rendered in case of any Jinja2 markup, always use this for listing.
readOnly: true
x-computed: true
page_title:
type: [string, 'null']
description: HTML <title> tag extracted from the page
readOnly: true
check_count:
type: integer
description: Total number of checks performed
readOnly: true
fetch_time:
type: number
description: Duration of last fetch in seconds
readOnly: true
previous_md5:
type: [string, boolean]
description: MD5 hash of previous content (false if not set)
readOnly: true
previous_md5_before_filters:
type: [string, boolean]
description: MD5 hash before filters applied (false if not set)
readOnly: true
consecutive_filter_failures:
type: integer
description: Counter for consecutive filter match failures
readOnly: true
last_notification_error:
type: [string, 'null']
description: Last notification error message
readOnly: true
notification_alert_count:
type: integer
description: Number of notifications sent
readOnly: true
content-type:
type: [string, 'null']
description: Content-Type from last fetch
readOnly: true
remote_server_reply:
type: [string, 'null']
description: Server header from last response
readOnly: true
browser_steps_last_error_step:
type: [integer, 'null']
description: Last browser step that caused an error
readOnly: true
viewed:
type: [integer, boolean]
description: Computed property - true if watch has been viewed, false otherwise (deprecated, use last_viewed instead)
readOnly: true
x-computed: true
history_n:
type: integer
description: Number of history snapshots available
readOnly: true
x-computed: true
processor_config_restock_diff:
type: object
readOnly: true
x-computed: true
description: |
Resolved restock/price processor config for this watch.
If a tag with `overrides_watch: true` is assigned to this watch, the tag's config is
returned here instead of the watch's own config. Use `processor_config_restock_diff_source`
to determine where the config originated.
properties:
in_stock_processing:
type: string
enum: [in_stock_only, all_changes, 'off']
follow_price_changes:
type: boolean
price_change_min:
type: [number, 'null']
price_change_max:
type: [number, 'null']
price_change_threshold_percent:
type: [number, 'null']
minimum: 0
maximum: 100
processor_config_restock_diff_source:
type: string
readOnly: true
x-computed: true
description: |
Indicates the origin of `processor_config_restock_diff`.
- `watch`: config comes from the watch itself
- `tag:<uuid>`: config is overridden by the tag with the given UUID
CreateWatch:
allOf:
- $ref: '#/components/schemas/WatchBase'
- type: 'object'
required:
- url
UpdateWatch:
allOf:
- $ref: '#/components/schemas/WatchBase' # Extends WatchBase for user-settable fields
- type: object
properties:
last_viewed:
type: integer
description: Unix timestamp in seconds of the last time the watch was viewed. Setting it to a value higher than `last_changed` in the "Update watch" endpoint marks the watch as viewed.
minimum: 0
# Note: ReadOnly and @property fields are filtered out in the backend before update
# We don't use unevaluatedProperties:false here to allow roundtrip GET/PUT workflows
# where the response includes computed fields that should be silently ignored
Tag:
allOf:
- $ref: '#/components/schemas/WatchBase'
- type: object
properties:
overrides_watch:
type: [boolean, 'null']
description: |
Whether this tag's settings override watch settings for all watches in this tag/group.
- true: Tag settings override watch settings
- false: Tag settings do not override (watches use their own settings)
- null: Not decided yet / inherit default behavior
url_match_pattern:
type: string
description: |
Automatically apply this tag to any watch whose URL matches this pattern.
Supports fnmatch wildcards (* and ?): e.g. *://example.com/* or github.com/myorg.
Plain strings are matched as case-insensitive substrings.
Leave empty to disable auto-matching.
# Future: Aggregated statistics from all watches with this tag
# check_count:
# type: integer
# description: Sum of check_count from all watches with this tag
# readOnly: true
# x-computed: true
# last_checked:
# type: integer
# description: Most recent last_checked timestamp from all watches with this tag
# readOnly: true
# x-computed: true
# last_changed:
# type: integer
# description: Most recent last_changed timestamp from all watches with this tag
# readOnly: true
# x-computed: true
CreateTag:
allOf:
- $ref: '#/components/schemas/Tag'
- type: object
required:
- title
NotificationUrls:
type: object
properties:
notification_urls:
type: array
items:
type: string
format: uri
description: List of notification URLs
required:
- notification_urls
SystemInfo:
type: object
properties:
watch_count:
type: integer
description: Total number of web page change monitors (watches)
tag_count:
type: integer
description: Total number of tags
uptime:
type: string
description: System uptime
version:
type: string
description: Application version
SearchResult:
type: object
properties:
watches:
type: object
additionalProperties:
$ref: '#/components/schemas/Watch'
description: Dictionary of matching web page change monitors (watches) keyed by UUID
WatchHistory:
type: object
additionalProperties:
type: string
description: Path to snapshot file
description: Dictionary of timestamps and snapshot paths
Error:
type: object
properties:
message:
type: string
description: Error message
paths:
/watch:
get:
operationId: listWatches
tags: [Watch Management]
summary: List all watches
description: Return concise list of available web page change monitors (watches) and basic info
x-code-samples:
- lang: 'curl'
source: |
curl -X GET "http://localhost:5000/api/v1/watch" \
-H "x-api-key: YOUR_API_KEY"
- lang: 'Python'
source: |
import requests
headers = {'x-api-key': 'YOUR_API_KEY'}
response = requests.get('http://localhost:5000/api/v1/watch', headers=headers)
print(response.json())
parameters:
- name: recheck_all
in: query
description: Set to 1 to force recheck of all watches
schema:
type: string
enum: ["1"]
- name: tag
in: query
description: Tag name to filter results
schema:
type: string
responses:
'200':
description: List of watches
content:
application/json:
schema:
type: object
additionalProperties:
$ref: '#/components/schemas/Watch'
example:
"095be615-a8ad-4c33-8e9c-c7612fbf6c9f":
uuid: "095be615-a8ad-4c33-8e9c-c7612fbf6c9f"
url: "http://example.com?id={{1+1}} - the raw URL"
link: "http://example.com?id=2 - the rendered URL, always use this for listing."
title: "Example Website Monitor - manually entered title/description"
page_title: "The HTML <title> from the page"
tags: ["550e8400-e29b-41d4-a716-446655440000"]
paused: false
notification_muted: false
method: "GET"
fetch_backend: "html_requests"
last_checked: 1640995200
last_changed: 1640995200
"7c9e6b8d-f2a1-4e5c-9d3b-8a7f6e4c2d1a":
uuid: "7c9e6b8d-f2a1-4e5c-9d3b-8a7f6e4c2d1a"
url: "http://example.com?id={{1+1}} - the raw URL"
link: "http://example.com?id=2 - the rendered URL, always use this for listing."
title: "News Site Tracker - manually entered title/description"
page_title: "The HTML <title> from the page"
tags: ["330e8400-e29b-41d4-a716-446655440001"]
paused: false
notification_muted: true
method: "GET"
fetch_backend: "html_webdriver"
last_checked: 1640998800
last_changed: 1640995200
post:
operationId: createWatch
tags: [Watch Management]
summary: Create a new watch
description: |
Create a single web page change monitor (watch). Requires at least `url` to be set.
Every watch can be configured with:
- **Processor mode**: `processor` field (`restock_diff` or `text_json_diff` - default)
- **Notification settings**: `notification_urls` (array), `notification_title`, `notification_body`, `notification_format`, `notification_muted`
- **Tags/Groups**: `tag` (UUID string) or `tags` (array of UUIDs)
- **Check settings**: `time_between_check`, `paused`, `method`, `fetch_backend`
- **Advanced options**: `headers`, `body`, `proxy`, `browser_steps`, and more
x-code-samples:
- lang: 'curl'
source: |
curl -X POST "http://localhost:5000/api/v1/watch" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"title": "Example Site Monitor",
"time_between_check": {
"hours": 1
}
}'
- lang: 'Python'
source: |
import requests
import json
headers = {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
'url': 'https://example.com',
'title': 'Example Site Monitor',
'time_between_check': {
'hours': 1
}
}
response = requests.post('http://localhost:5000/api/v1/watch',
headers=headers, json=data)
print(response.text)
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateWatch'
example:
url: "https://example.com"
title: "Example Site Monitor"
time_between_check:
hours: 1
responses:
'200':