Opera News Plugin

OpenClaw plugin for Opera News API - provides AI assistants access to Opera News content

Install

openclaw plugins install clawhub:opera-news-plugin

Opera News Plugin for OpenClaw

OpenClaw Plugin for Opera News API - Provides AI assistants seamless access to Opera News content

npm version License: MIT Node.js Version

Overview

Opera News Plugin is an OpenClaw plugin that exposes Opera News API functionality to AI assistants. It provides:

  • 6 Tools for news retrieval, search, and configuration
  • Multi-region support (US, UK, Nigeria, South Africa, Kenya, Ghana, Brazil, Mexico)
  • AI-optimized endpoints with minimal response payloads
  • Config injected by OpenClaw — no manual environment variable management required

Installation

# Install via OpenClaw CLI
openclaw plugins install opera-news-plugin

# Or from local directory
openclaw plugins install /path/to/opera-news-plugin

# Verify
openclaw plugins list

Plugin Configuration

Configure via OpenClaw's plugin settings UI or config file:

{
  "plugins": {
    "opera-news": {
      "apiBaseUrl": "https://news-af.feednews.com",
      "defaultCountry": "us",
      "defaultLanguage": "en",
      "defaultProduct": "openclaw",
      "cacheTTL": 300000,
      "requestTimeout": 10000
    }
  }
}
FieldTypeDefaultDescription
apiBaseUrlstringhttps://news-af.feednews.comOpera News API base URL
defaultCountrystringus2-letter country code
defaultLanguagestringenLanguage code
defaultProductstringopenclawProduct identifier
cacheTTLnumber300000Cache TTL in milliseconds
requestTimeoutnumber10000API request timeout in milliseconds

Available Tools

1. get_news_feed — Get Main News Feed

Fetches the main Opera News feed with optional filtering by region, language, and product. Supports pagination.

Parameters:

ParameterTypeRequiredDescription
countrystringNoCountry code: us, gb, ng, za, ke, gh, br, mx (defaults to plugin config)
languagestringNoLanguage code, e.g. en, pt, es, sw (defaults to plugin config)
productstringNoProduct identifier, e.g. opera, ofa, mini
pagenumberNoPage number for pagination (starting from 1)
limitnumberNoNumber of articles per page

Response: JSON with an articles array. Each article contains:

FieldTypeDescription
titlestringArticle headline
summarystringShort excerpt of the article
thumbnailstring[]Array of image URLs (may be empty)
transcoded_urlstringLink to the full article — use this for "Read more" links

2. get_category_news — Get News by Category

Fetches news articles for a specific category such as technology, sports, or entertainment. Use get_categories first to retrieve valid category IDs.

Parameters:

ParameterTypeRequiredDescription
categoryIdstringYesCategory ID (retrieve via get_categories)
countrystringNoCountry code (see supported regions)
languagestringNoLanguage code
productstringNoProduct identifier
pagenumberNoPage number for pagination
limitnumberNoNumber of articles per page

Response: Same structure as get_news_feed — JSON with an articles array containing title, summary, thumbnail, transcoded_url.


3. mcp_search_news — Search News (AI-Optimized)

Searches news by keyword and returns a minimal set of fields. Optimized for AI tool consumption to reduce token usage.

Parameters:

ParameterTypeRequiredDescription
querystringYesSearch keyword(s)
countrystringNoCountry code (see supported regions)
languagestringNoLanguage code
productstringNoProduct identifier
pagenumberNoPage number for pagination
limitnumberNoNumber of results per page
sortstringNoSort order: relevance or date

Response: JSON with an articles array. Each article contains only:

FieldTypeDescription
titlestringArticle headline
summarystringShort excerpt of the article
transcoded_urlstringLink to the full article

4. mcp_get_top_news — Get Top Headlines (AI-Optimized)

Fetches current top headlines. Optimized for AI tool consumption with minimal fields.

Parameters:

ParameterTypeRequiredDescription
countrystringNoCountry code (see supported regions)
languagestringNoLanguage code
productstringNoProduct identifier
pagenumberNoPage number for pagination
limitnumberNoNumber of articles per page

Response: Same minimal structure as mcp_search_newstitle, summary, transcoded_url only.


5. search_news — Search News (Standard)

Searches news by keyword and returns full article fields including images.

Parameters:

ParameterTypeRequiredDescription
querystringYesSearch keyword(s)
countrystringNoCountry code (see supported regions)
languagestringNoLanguage code
productstringNoProduct identifier
pagenumberNoPage number for pagination
limitnumberNoNumber of results per page
sortstringNoSort order: relevance or date

Response: Same full structure as get_news_feedtitle, summary, thumbnail, transcoded_url.

vs mcp_search_news: Returns complete article fields including thumbnail. Use mcp_search_news when only title/summary/url are needed (saves tokens).


6. get_categories — Get News Categories

Returns the list of available news categories for a given region. Use the returned IDs with get_category_news.

Parameters:

ParameterTypeRequiredDescription
countrystringNoCountry code (defaults to plugin config)
languagestringNoLanguage code (defaults to plugin config)

Response: A JSON array of category objects. Each item contains:

FieldTypeDescription
idstringCategory ID — pass this to get_category_news
namestringHuman-readable category name
thumbnailstringCategory thumbnail image URL
locationstringDisplay position of the category tab (e.g. bottom)

Supported Regions

This plugin supports news content for the following regions. Asian markets (e.g. Indonesia, India) are not supported.

RegionCountryCodeLanguages
North AmericaUnited Statesusen
EuropeUnited Kingdomgben
AfricaNigeriangen
AfricaSouth Africazaen
AfricaKenyakeen, sw
AfricaGhanaghen
Latin AmericaBrazilbrpt
Latin AmericaMexicomxes

Development

Prerequisites

  • Node.js >= 18.0.0
  • npm

Setup

git clone https://github.com/zerokileom/opera-news-plugin.git
cd opera-news-plugin
npm install
npm run build
npm test

Project Structure

opera-news-plugin/
├── src/
│   ├── openclaw-entry.ts    # Plugin entry — definePluginEntry + all 6 tools
│   ├── client/
│   │   ├── news-client.ts   # HTTP client (accepts ClientConfig from OpenClaw)
│   │   └── types.ts         # API type definitions
│   └── utils/
│       ├── config.ts        # Env-var fallback config (for local dev/testing)
│       ├── logger.ts        # Structured logging with sensitive field redaction
│       └── error-handler.ts # Error categorization and retry logic
├── openclaw.plugin.json     # Plugin manifest and configSchema
├── manifest.json            # Entry point declaration
└── package.json

Error Handling

  • 7 error categories: NETWORK, TIMEOUT, RATE_LIMIT, AUTH, VALIDATION, SERVER, NOT_FOUND
  • Exponential backoff with jitter for retryable errors
  • Maximum 3 retries for network, timeout, and rate-limit errors

Logging

Structured JSON logging. Sensitive fields (query, device_id) are always redacted before writing to logs.

LOG_LEVEL=debug   # debug | info | warn | error  (local dev only)
LOG_FORMAT=text   # json | text

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Submit a pull request

License

MIT License — see LICENSE

Links