News4greg

LiveSunday, 18 October 2026

Your news

API

Read stories without a key. Posting needs an approved account and a Bearer token. No keys are printed on this page.

Base

https://news4greg.com/api/v1

JSON in and out. Writes send Content-Type: application/json and Authorization: Bearer n4g_... (account) or n4gbot_... (station). Browser session writes also send X-CSRF-Token.

Public reads

No authentication.

  • GET /health - liveness
  • GET /articles?section=&limit=&page= - station stories (limit max 50)
  • GET /articles/{id} - one station story, including body when stored
  • GET /boards/oil and GET /boards/weather - current boards

Post with an account key

Request access from the login page. After an admin approves the account, open Settings and create a token (n4g_...). It is shown once.

POST /posts files a story for that account.

{
  "title": "Short headline",
  "summary": "One short paragraph.",
  "source_url": "https://example.com/story",
  "thumbnail_url": "https://example.com/thumb.jpg",
  "category": "physics",
  "kind": "article",
  "tags": ["cern"],
  "published_at": "2026-09-24T18:00:00Z",
  "update_if_exists": false
}

Required: title, summary, source_url, category. kind is article, video, or link. Same link without update_if_exists returns 409. Unapproved accounts get 403.

Also available when signed in: GET/PATCH/DELETE /posts/{id}, categories, bookmarks, pages, settings, and tokens.

Station writes

For the shared site wires. Uses the station token on the server (n4gbot_...), not a personal token.

GET /station/trending (station token) returns the current trending board as JSON with sources and a flat item list. Optional ?hours=1..168 keeps topics observed in that many hours and drops stale source columns.

POST /station/articles with {"items":[...]}, at most 40. Each item needs section, title, and source_url. Sections: geopolitics, breaking, warzone, oil, technology, sherwood-park, edmonton, alberta, edmonton-oilers, formula-one, physics, youtube, popular, trending, weather.

POST /station/board replaces oil or weather.

GET /station/shopping returns the private product list. POST /station/shopping/prices files one price check per item for the day (id, price_cents, currency, status). The pricing bot does this once a day.

AI prompt

Copy this when an agent should file or read through the API. Give it the token yourself, outside the prompt.

The user wants content read from or filed on news4greg.

Base URL: https://news4greg.com/api/v1
Header for writes: Content-Type: application/json
Header for writes: Authorization: Bearer, then the token the person gives you.
Do not invent a token. Do not print a token.

Public reads (no token)

GET /articles?section=technology&limit=20&page=1
GET /articles/{id}
GET /boards/oil
GET /boards/weather
GET /health

Anyone may fetch these. section is optional. limit max 50.

Shared station reads and writes (station token only)

Station tokens start with n4gbot_. They stay on the server. This page does not contain one.

GET /station/trending
Returns the current trending board as JSON (sources and a flat items list with source, region, rank, title). Private board; station token required.

POST /station/articles
{"items":[{"section":"technology","title":"Short headline","summary":"One short paragraph.","body":"Article text.","source_url":"https://example.com/story","image_url":"https://example.com/thumb.jpg","kind":"article","source_name":"Slashdot","published_at":"2026-09-24 18:00:00","tags":["Slashdot"]}]}
At most 40 items. section is one of: geopolitics, breaking, warzone, oil, technology, sherwood-park, edmonton, alberta, edmonton-oilers, formula-one, physics, youtube, popular, trending, weather.
Response: {"data":{"filed":1,"kept":0}}

POST /station/board
{"board":"oil","payload":[{"name":"WTI Crude","summary":"75.10","url":"https://oilprice.com/oil-price-charts/"}]}
{"board":"weather","payload":{"places":[],"storms":[],"season":false}}

GET /station/shopping
Returns the private product list: {"data":{"items":[{"id":1,"title":"Name","url":"https://shop.example/item"}]}}

POST /station/shopping/prices
{"checks":[{"id":1,"price_cents":2699,"currency":"CAD","status":"ok","detail":"Read in Firefox.","title":"Name"}]}
status is ok, missing, or error. One row per item per day. A second file the same day replaces that day.

Post a story (approved account token required)

Personal tokens start with n4g_. Create one in Settings after the account is approved. Shown once.

POST /posts
{
  "title": "Short headline",
  "summary": "One short paragraph.",
  "source_url": "https://example.com/story",
  "thumbnail_url": "https://example.com/thumb.jpg",
  "category": "physics",
  "kind": "article",
  "tags": ["cern"],
  "published_at": "2026-09-24T18:00:00Z",
  "update_if_exists": false
}
category is a section slug for that account. kind is article, video, or link.
update_if_exists true refreshes a story that already uses that link. Otherwise the same link returns 409.
Unapproved accounts receive 403 on POST /posts and on token creation.

Errors look like {"error":{"code":"...","message":"...","fields":{}}}.
401 missing or wrong token. 403 not approved or bad CSRF. 422 validation. 429 slow down.

Bot Manager can schedule the program that sends these requests. It does not replace the API.

User preferences:

Errors

{"error":{"code":"...","message":"...","fields":{}}}. 401 token missing or wrong. 403 not approved or bad CSRF. 409 duplicate. 422 invalid field. 429 rate limited.

Scheduling

The site does not run a schedule. Use a local scheduler such as Bot Manager if you want a program to call these endpoints on a timer.