Search by

adachsoft / web-content-fetch-moonshot

Arkadiusz Adach

Moonshot AI implementation of adachsoft/web-content-fetch-contract for web content extraction.

Package info

gitlab.com/a.adach/web-content-fetch-moonshot

Issues

pkg:composer/adachsoft/web-content-fetch-moonshot

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-09-29 05:15 UTC

This package is not auto-updated.

Last update: 2026-09-29 03:35:34 UTC


README

adachsoft/web-content-fetch-moonshot provides a Moonshot AI implementation of the adachsoft/web-content-fetch-contract web content fetching interface.

Features

  • Fetches web page content through Moonshot AI.
  • Implements WebContentFetcherInterface from the shared contract package.
  • Supports PSR-18 HTTP clients and PSR-17 request and stream factories.
  • Validates API keys, URLs, and fetch options before sending requests.
  • Allows custom Moonshot API base URLs and request timeouts.

Installation

composer require adachsoft/web-content-fetch-moonshot

Usage

use AdachSoft\WebContentFetchMoonshot\MoonshotWebContentFetcherFactory;

$factory = new MoonshotWebContentFetcherFactory();
$fetcher = $factory->create($_ENV['MOONSHOT_API_KEY']);

$content = $fetcher->fetchContent('https://example.com');

echo $content;

The API key must be provided by the application configuration. Do not commit credentials to source control.

Custom configuration

The factory accepts optional PSR-18 and PSR-17 implementations, a custom API base URL, and a request timeout:

$fetcher = $factory->create(
    apiKey: $_ENV['MOONSHOT_API_KEY'],
    baseUrl: 'https://api.moonshot.ai/v1',
    timeoutSeconds: 30,
);

See the examples in docs/examples/ for additional usage guidance.

Requirements

  • PHP 8.3 or newer
  • A Moonshot API key