-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.http
More file actions
161 lines (128 loc) · 4.87 KB
/
Copy pathapi.http
File metadata and controls
161 lines (128 loc) · 4.87 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
### Distill API examples
#
# Requires the VS Code "REST Client" extension (humao.rest-client).
# Start the server first:
#
# go run .
#
# Then use the "Send Request" CodeLens above each request below. Requests
# that reference {{name.response.body...}} depend on an earlier named
# request (# @name ...) having been sent first in this same session, so
# work through the file top to bottom the first time.
@baseUrl = http://localhost:8080
@apiKey = {{$dotenv API_KEY}}
### 1. Create feed: The New Stack (one of the 4 feeds from bootstrapFeeds)
# @name feedNewStack
POST {{baseUrl}}/feeds
Authorization: Bearer {{apiKey}}
Content-Type: application/json
{
"source_url": "https://thenewstack.io/blog/feed/"
}
### 2. Create feed: DigitalOcean Blog
# @name feedDigitalOcean
POST {{baseUrl}}/feeds
Authorization: Bearer {{apiKey}}
Content-Type: application/json
{
"source_url": "https://www.digitalocean.com/blog.atom"
}
### 3. Create feed: GitLab
# @name feedGitLab
POST {{baseUrl}}/feeds
Authorization: Bearer {{apiKey}}
Content-Type: application/json
{
"source_url": "https://about.gitlab.com/atom.xml"
}
### 4. Create feed: CNCF
# @name feedCncf
POST {{baseUrl}}/feeds
Authorization: Bearer {{apiKey}}
Content-Type: application/json
{
"source_url": "https://www.cncf.io/feed/"
}
### Creating the same feed again is rejected (409 Conflict)
POST {{baseUrl}}/feeds
Authorization: Bearer {{apiKey}}
Content-Type: application/json
{
"source_url": "https://www.cncf.io/feed/"
}
### List every registered feed
GET {{baseUrl}}/feeds
Authorization: Bearer {{apiKey}}
### Get a single feed by ID
GET {{baseUrl}}/feeds/{{feedNewStack.response.body.$.id}}
Authorization: Bearer {{apiKey}}
### Update a feed's source URL
PUT {{baseUrl}}/feeds/{{feedGitLab.response.body.$.id}}
Authorization: Bearer {{apiKey}}
Content-Type: application/json
{
"source_url": "https://about.gitlab.com/atom.xml"
}
### Crawl every registered feed and store their entries
# @name refreshAll
POST {{baseUrl}}/feeds/refresh
Authorization: Bearer {{apiKey}}
### List entries belonging to a single feed
GET {{baseUrl}}/feeds/{{feedNewStack.response.body.$.id}}/entries
Authorization: Bearer {{apiKey}}
### Keyword search: how many entries mention "Kubernetes" in title OR summary?
# The response is a JSON array - its length is the match count.
# @name kubernetesMatches
GET {{baseUrl}}/entries?keyword=Kubernetes
Authorization: Bearer {{apiKey}}
### Read: full details (including content) of the first Kubernetes match
GET {{baseUrl}}/entries/{{kubernetesMatches.response.body.$[0].id}}
Authorization: Bearer {{apiKey}}
### List entries published after a given date
GET {{baseUrl}}/entries?after=2026-01-01T00:00:00Z
Authorization: Bearer {{apiKey}}
### List every stored entry (no filter)
GET {{baseUrl}}/entries
Authorization: Bearer {{apiKey}}
### Generate a daily brief from the last 24h of entries (needs ANTHROPIC_API_KEY in .env)
# Both steps (extract + reason) default to claude when neither param is given.
POST {{baseUrl}}/digest?provider=claude
Authorization: Bearer {{apiKey}}
### Same, but via OpenAI for both steps (needs OPENAI_API_KEY in .env)
# extract_provider isn't given, so it defaults to whatever provider resolved
# to (openai) - set OPENAI_EXTRACT_MODEL / OPENAI_REASON_MODEL in .env to
# still use two different models within the one provider.
POST {{baseUrl}}/digest?provider=openai
Authorization: Bearer {{apiKey}}
### Same, but via DeepSeek for both steps (needs DEEPSEEK_API_KEY in .env)
POST {{baseUrl}}/digest?provider=deepseek
Authorization: Bearer {{apiKey}}
### Cheap OpenAI model to filter/summarize, Claude to reason and write the brief
# (needs OPENAI_API_KEY and ANTHROPIC_API_KEY in .env; set OPENAI_EXTRACT_MODEL
# to a cheap model like gpt-5-nano to control extraction-step cost)
POST {{baseUrl}}/digest?extract_provider=openai&provider=claude
Authorization: Bearer {{apiKey}}
### Generate a brief and email it via web.de (needs WEBDE_EMAIL_USER/PASSWORD in .env)
POST {{baseUrl}}/digest?provider=claude&to=you@web.de&email_provider=webde
Authorization: Bearer {{apiKey}}
### Same, but sent via Gmail (needs GMAIL_EMAIL_USER/PASSWORD in .env)
POST {{baseUrl}}/digest?provider=claude&to=you@gmail.com&email_provider=gmail
Authorization: Bearer {{apiKey}}
### List every previously generated digest
GET {{baseUrl}}/digests
Authorization: Bearer {{apiKey}}
### Get a single digest by ID
GET {{baseUrl}}/digests/1
Authorization: Bearer {{apiKey}}
### Delete a feed - cascades and removes its stored entries too
DELETE {{baseUrl}}/feeds/{{feedCncf.response.body.$.id}}
Authorization: Bearer {{apiKey}}
### The deleted feed is now gone (404 Not Found)
GET {{baseUrl}}/feeds/{{feedCncf.response.body.$.id}}
Authorization: Bearer {{apiKey}}
### Delete every feed - cascades and removes all stored entries too
DELETE {{baseUrl}}/feeds
Authorization: Bearer {{apiKey}}
### Every feed is now gone
GET {{baseUrl}}/feeds
Authorization: Bearer {{apiKey}}