# Jina AI

> Read web pages as clean markdown, search the web, rerank documents, and classify text with Jina AI's Search Foundation APIs.

App · AI Search & Memory · 4 actions. Web page: https://docs.lodol.com/docs/integrations/jina

## Actions

### Classify text

Sort each piece of text into one of your own labels using Jina's zero-shot classifier: no training needed. Great for tagging, routing, or sentiment.

**Inputs**

- Texts (`inputs`, list, required): The list of text snippets to classify.
- Labels (`labels`, list, required): The list of possible labels, for example 'Positive', 'Neutral', 'Negative'.

**Outputs**

- `results` (list): One prediction per input text, in order
- `tokens` (number): Tokens Jina counted for this request

**Example output**

```json
{
  "results": [
    {
      "index": 0,
      "prediction": "Positive",
      "score": 0.91,
      "text": "I love this product, it works great!"
    },
    {
      "index": 1,
      "prediction": "Negative",
      "score": 0.87,
      "text": "The delivery was late and the box was damaged."
    }
  ],
  "tokens": 19
}
```

### Read a URL

Fetch a web page through the Jina Reader and return it as clean, LLM-ready markdown: ideal for feeding a page into a later AI step.

**Inputs**

- URL (`url`, text, required): The web page to read, for example 'https://jina.ai'.
- Include links (`with_links`, true/false): Optional. Also return a list of the links found on the page. Default: `false`.
- Include images (`with_images`, true/false): Optional. Also return a list of the images found on the page. Default: `false`.
- Bypass cache (`no_cache`, true/false): Optional. Fetch a fresh copy instead of Jina's cached version. Default: `false`.

**Outputs**

- `content` (text): The page content as clean markdown
- `description` (text): The page's meta description, if any
- `images` (list): Images on the page. Empty unless 'Include images' is on.
- `links` (list): Links on the page. Empty unless 'Include links' is on.
- `title` (text): The page's title
- `tokens` (number): Tokens Jina counted for this page
- `url` (text): The URL that was read

**Example output**

```json
{
  "content": "Jina AI - Your Search Foundation, Supercharged.\n===============\nBest-in-class embeddings and rerankers...",
  "description": "Best-in-class embeddings, rerankers, LLM-reader, web scraper, classifiers.",
  "images": [
    {
      "text": "Jina logo",
      "url": "https://jina.ai/Jina%20-%20Dark.svg"
    }
  ],
  "links": [
    {
      "text": "Contact sales",
      "url": "https://jina.ai/contact-sales"
    }
  ],
  "title": "Jina AI - Your Search Foundation, Supercharged.",
  "tokens": 1234,
  "url": "https://jina.ai/"
}
```

### Rerank documents

Reorder a list of documents by how relevant each one is to a query: useful for picking the best matches out of search or database results.

**Inputs**

- Query (`query`, text, required): The query to rank the documents against.
- Documents (`documents`, list, required): The list of text documents to reorder by relevance.
- Top N (`top_n`, number): Optional. Return only the top N most relevant documents. At least 1.

**Outputs**

- `results` (list): Documents ordered from most to least relevant
- `tokens` (number): Tokens Jina counted for this request
- `top_document` (text): The single most relevant document, for convenience

**Example output**

```json
{
  "results": [
    {
      "document": "Organic skincare for sensitive skin with aloe vera",
      "index": 0,
      "relevance_score": 0.9
    },
    {
      "document": "Fragrance-free moisturizer for dry skin",
      "index": 2,
      "relevance_score": 0.8
    }
  ],
  "tokens": 15,
  "top_document": "Organic skincare for sensitive skin with aloe vera"
}
```

### Search the web

Search the web through Jina and get back LLM-ready results. Returns titles, URLs, and snippets by default, or full page content when asked.

**Inputs**

- Search query (`query`, text, required): What to search for, for example 'best vector databases'.
- Number of results (`num_results`, number): Optional. How many results to return (1-20). From 1 to 20.
- Limit to site (`site`, text): Optional. Restrict the search to one domain, for example 'https://jina.ai'.
- Country (`country`, text): Optional. Two-letter country code to search from, for example 'US'.
- Include page content (`include_page_content`, true/false): Optional. Fetch the full markdown of each result page. Slower and uses far more tokens; off by default. Default: `false`.

**Outputs**

- `results` (list): Search results, most relevant first
- `tokens` (number): Total tokens Jina counted across the results

**Example output**

```json
{
  "results": [
    {
      "content": "",
      "description": "Our frontier models form the search foundation for high-quality enterprise search.",
      "title": "Jina AI - Your Search Foundation, Supercharged.",
      "url": "https://jina.ai/"
    }
  ],
  "tokens": 0
}
```
