Medicine Technology 🌱 Environment Space Energy Physics Engineering Social Science Earth Science Science

REST API Documentation

Access Press-News.org data programmatically. Read operations are free and open. Write operations require an API key.

Base URL: https://press-news.org/api/ Format: JSON Rate Limit: 60 req/min

List Articles

GET /api/?action=list

Returns paginated list of articles. Supports filtering by category and date range.

ParameterTypeDescription
pageintPage number (default: 1)
limitintArticles per page, max 100 (default: 25)
categorystringFilter by category keyword
sortstringdesc (default) or asc
date_fromstringStart date (YYYY-MM-DD)
date_tostringEnd date (YYYY-MM-DD)
GET /api/?action=list&page=1&limit=10&category=medicine

{
  "data": [
    {
      "id": 160001,
      "title": "New Cancer Treatment Shows Promise",
      "excerpt": "Researchers at MIT have...",
      "date": "2026-03-15",
      "category": "Medicine",
      "url": "https://press-news.org/160001-new-cancer-treatment.html",
      "image": "https://press-news.org/img/n/abc123_s1.webp"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 52340,
    "total_pages": 5234,
    "has_next": true,
    "has_prev": false
  }
}

Get Single Article

GET /api/?action=get&id={id}

Returns full article with body text, images, and contact info.

GET /api/?action=get&id=160001

{
  "data": {
    "id": 160001,
    "title": "New Cancer Treatment Shows Promise",
    "excerpt": "Researchers at MIT have...",
    "subtitle": "Phase III trial results",
    "press_info": "MIT News Office",
    "body": "<p>Full HTML article text...</p>",
    "date": "2026-03-15",
    "category": "Medicine",
    "url": "https://press-news.org/160001-new-cancer-treatment.html",
    "images": [
      {
        "thumbnail": "https://press-news.org/img/n/abc_s1.webp",
        "full": "https://press-news.org/img/n/abc_1.webp"
      }
    ],
    "contact": "press@mit.edu"
  }
}

Search Articles

GET /api/?action=search&q={query}

Full-text search across titles and excerpts. Minimum 3 characters.

ParameterTypeDescription
qstringSearch query (min 3 chars, required)
pageintPage number (default: 1)
limitintResults per page, max 50 (default: 20)

Site Statistics

GET /api/?action=stats

Returns article counts, date ranges, and available endpoints.

List Categories

GET /api/?action=categories

Returns all available categories with slugs, icons, and URLs.

Create Article

POST /api/?action=create

Create a new article. Requires API key with write permission.

FieldTypeRequiredDescription
titlestringYesArticle headline
bodystringYesFull article HTML
excerptstringNoShort summary
subtitlestringNoSubtitle / subheadline
press_infostringNoSource attribution
contactstringNoContact info
datestringNoDate (default: now)
POST /api/?action=create
Headers: X-API-Key: your-api-key
Content-Type: application/json

{
  "title": "New Discovery in Quantum Physics",
  "body": "<p>Scientists have discovered...</p>",
  "excerpt": "A breakthrough in quantum computing",
  "press_info": "Stanford University"
}

Update Article

PUT /api/?action=update&id={id}

Update an existing article. Supports partial updates. Requires API key with write permission.

PUT /api/?action=update&id=160001
Headers: X-API-Key: your-api-key
Content-Type: application/json

{
  "id": 160001,
  "title": "Updated: New Discovery in Quantum Physics",
  "excerpt": "Updated summary..."
}

Delete Article

DELETE /api/?action=delete&id={id}

Permanently delete an article. Requires API key with delete permission.

Authentication

Read operations (list, get, search, stats, categories) are open and free.

Write operations (create, update, delete) require an API key. Send it via the X-API-Key header:

curl -X POST https://press-news.org/api/?action=create \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key-here" \
  -d '{"title": "...", "body": "..."}'

To request an API key, contact us.

Error Handling

All errors return a JSON object with an error field:

{
  "error": "Article not found"
}

HTTP Status Codes:
  200 - Success
  201 - Created
  400 - Bad Request
  401 - Unauthorized
  404 - Not Found
  405 - Method Not Allowed
  429 - Rate Limited
  500 - Server Error