Skip to content

Web and Gemini-compatible ​

MoonNexAI provides web search, web reading, and Gemini-compatible content to generate API. They are suitable for applications that require real-time information, text extraction, text interpretation or access in Gemini format.

Web Search ​

bash
curl https://moonnexai.com/v1/web-search/search \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "MoonNexAI API documentation",
    "area": "global",
    "count": 10,
    "format": "json"
  }'

Common field:

fieldTypeAnnotations
querystringSearch for keywords.
areastringOptional. global or cn.
freshnessstringOptional. Day, Week, Month, Year.
includeImagesbooleanOptional. Do you have a picture result?
pageintegerOptional. Page number.
countintegerOptional. Number of pages per page.
formatstringOptional. json, markdown, md, text, txt.

Web Read ​

bash
curl https://moonnexai.com/v1/web-reader/read \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/article",
    "format": "md",
    "liteMode": true,
    "includeImages": true
  }'

Common field:

fieldTypeAnnotations
urlstringURL to read.
formatstringreturns the format.
liteModebooleanWhether to enable a streamlined mode.
includeImagesbooleanWhether to include pictures.
onlyCSSSelectorsstring[]Optional. Read only the content of the matching selection.
waitForCSSSelectorsstring[]Optional. Wait for the specified element to appear before reading.

Gemini-compatible ​

bash
curl https://moonnexai.com/v1beta/models/gemini-compatible:generateContent \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "写一段简短的产品介绍。"
          }
        ]
      }
    ]
  }'

Picture understands the use of inlineData:

json
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "描述这张图片。"
        },
        {
          "inlineData": {
            "mimeType": "image/png",
            "data": "<BASE64_IMAGE>"
          }
        }
      ]
    }
  ]
}

Use recommendations ​

  • The search for API is suitable for candidate pages and abstracts, and the reading of API is suitable for extracting the main text of the specified web page.
  • When the same page is processed on several occasions, it is recommended that the reading results be Cacheed.
  • The model name of the path should be consistent with the model available in the MoonNexAI console when using Gemini-compatible API.
  • Pictures, PDF, audio or video input suggest that the file be kept in size to avoid an oversized request.

See the API Reference for additional fields and response structures.