jina

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package jina is web search and page reading through Jina AI (checked 2026-09-26): s.jina.ai for search, about $0.50 per 1,000 searches ($0.05 per million tokens, at least 10,000 a search, 100 requests a minute), and r.jina.ai for pages built with JavaScript, PDFs and sites that block plain fetches, about $0.25–$0.50 per 1,000 pages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PlainSnippet

func PlainSnippet(markdown string) string

PlainSnippet turns Jina's markdown into a plain-text snippet. The TS adapter follows the same rules: images go, links keep their text, bold, code and heading marks go, spaces collapse, and it is cut at 300 characters counted as JavaScript counts them.

Types

type Client

type Client struct {
	APIKey  string
	BaseURL string
	HTTP    *http.Client
}

Client is what both Jina adapters share.

type Reader

type Reader struct{ Client }

Reader is a ports.Fetcher on r.jina.ai. Jina fetches the page from its own servers, so your network is never reached. Use it where the page reader comes back empty or blocked.

func NewReader

func NewReader(apiKey string) (*Reader, error)

NewReader is a Jina reader with an API key.

func (*Reader) Fetch

func (j *Reader) Fetch(ctx context.Context, target string, opts ports.FetchOptions) (ports.FetchedPage, error)

func (*Reader) Name

func (j *Reader) Name() string

type WebSearch

type WebSearch struct{ Client }

WebSearch is a ports.Search on s.jina.ai. Cheaper than Brave, slower and more limited: for low traffic where cost matters most. Jina returns each result's page text; only a short snippet is kept, so the model still opens only the pages it needs. It has no recency filter, so Recency is ignored.

func NewWebSearch

func NewWebSearch(apiKey string) (*WebSearch, error)

NewWebSearch is a Jina search with an API key.

func (*WebSearch) Name

func (j *WebSearch) Name() string

func (*WebSearch) Search

func (j *WebSearch) Search(ctx context.Context, query string, opts ports.SearchOptions) ([]ports.SearchHit, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL