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:
| field | Type | Annotations |
|---|---|---|
query | string | Search for keywords. |
area | string | Optional. global or cn. |
freshness | string | Optional. Day, Week, Month, Year. |
includeImages | boolean | Optional. Do you have a picture result? |
page | integer | Optional. Page number. |
count | integer | Optional. Number of pages per page. |
format | string | Optional. 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:
| field | Type | Annotations |
|---|---|---|
url | string | URL to read. |
format | string | returns the format. |
liteMode | boolean | Whether to enable a streamlined mode. |
includeImages | boolean | Whether to include pictures. |
onlyCSSSelectors | string[] | Optional. Read only the content of the matching selection. |
waitForCSSSelectors | string[] | 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.