---
title: "Xiaohongshu (RedNote) Ask Dots AI API"
description: "Queries Xiaohongshu (RedNote) Ask Dots AI with a keyword question. Use it to retrieve an AI answer for topic research and question exploration."
aiUsagePrompt: true
---

# Xiaohongshu \(RedNote\) Ask Dots AI API

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/xiaohongshu/ask-dots\"")'
  :summary='JSON.parse("\"Ask Dots AI\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/xiaohongshu-rednote/ask-dots-ai-en.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"Access token for this API service.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"keyword\",\"in\":\"query\",\"description\":\"Question or keyword to submit to Ask Dots AI.\",\"required\":true,\"schema\":{\"type\":\"string\"}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":[\"object\",\"null\"],\"description\":\"Answer returned by Xiaohongshu Ask Dots, with answer elements and source items when provided.\",\"properties\":{\"answer_status\":{\"type\":\"integer\",\"description\":\"Reported status code for the generated answer.\"},\"has_more_sources\":{\"type\":\"boolean\",\"description\":\"Whether the answer reports additional source items beyond those returned here.\"},\"base_info\":{\"type\":\"object\",\"description\":\"Display information and source counts for the answer.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Answer identifier returned as text.\"},\"long_id\":{\"type\":\"integer\",\"description\":\"Numeric identifier returned with the answer. This integer can exceed the JavaScript safe integer range.\"},\"note_title\":{\"type\":\"string\",\"description\":\"Title returned in the answer information.\"},\"text\":{\"type\":\"string\",\"description\":\"Display text returned with the answer information.\"},\"nickname\":{\"type\":\"string\",\"description\":\"Display name returned with the answer.\"},\"avatar\":{\"type\":\"string\",\"description\":\"Avatar image URL returned with the answer.\"},\"dark_avatar\":{\"type\":\"string\",\"description\":\"Avatar image URL for dark display, when provided.\"},\"total_count\":{\"type\":\"integer\",\"description\":\"Source count reported with the answer. It can exceed the number of source items returned.\"},\"totalCnt\":{\"type\":\"string\",\"description\":\"Source count label as display text. The label can contain words.\"},\"source_avatars\":{\"type\":\"array\",\"description\":\"Avatars returned for sources shown with the answer.\",\"items\":{\"type\":\"string\",\"description\":\"Avatar image URL for one displayed source.\"}}}},\"elements\":{\"type\":\"array\",\"description\":\"Content blocks in the generated answer.\",\"items\":{\"type\":\"object\",\"description\":\"One answer block. Its content fields depend on the block type.\",\"properties\":{\"element_type\":{\"type\":\"string\",\"description\":\"Type label reported for the answer block.\"},\"markdown\":{\"type\":\"object\",\"description\":\"Markdown content for this answer block.\",\"properties\":{\"text\":{\"type\":\"string\",\"contentMediaType\":\"text/markdown\",\"description\":\"Generated Markdown text for this answer block.\"}}},\"image\":{\"type\":\"object\",\"description\":\"Images included in this answer block.\",\"properties\":{\"image_list\":{\"type\":\"array\",\"description\":\"Image entries for the answer block.\",\"items\":{\"type\":\"object\",\"description\":\"One image included in the answer block.\",\"properties\":{\"file_id\":{\"type\":\"string\",\"description\":\"File identifier for this answer image.\"},\"width\":{\"type\":\"integer\",\"description\":\"Reported width of the answer image.\"},\"height\":{\"type\":\"integer\",\"description\":\"Reported height of the answer image.\"},\"url\":{\"type\":\"string\",\"description\":\"URL returned for the answer image.\"},\"url_size_large\":{\"type\":\"string\",\"description\":\"Large image URL returned for the answer image.\"},\"source_avatar\":{\"type\":\"string\",\"description\":\"Source avatar URL returned with the answer image.\"},\"source_nickname\":{\"type\":\"string\",\"description\":\"Source display name returned with the answer image.\"},\"user_id\":{\"type\":\"string\",\"description\":\"User identifier returned with the answer image.\"}}}}}},\"spark\":{\"type\":\"object\",\"description\":\"Answer block that can contain highlighted Markdown.\",\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"Highlight content for this answer block.\",\"properties\":{\"highlight_markdown\":{\"type\":\"string\",\"contentMediaType\":\"text/markdown\",\"description\":\"Highlighted Markdown returned for this answer block.\"}}}}}}}},\"items\":{\"type\":\"array\",\"description\":\"Source items returned for the answer.\",\"items\":{\"type\":\"object\",\"description\":\"One cited source item. Available fields vary by source.\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"Reported source item identifier. Its form can vary by source.\"},\"title\":{\"type\":\"string\",\"description\":\"Title of the cited source item.\"},\"subtitle\":{\"type\":\"string\",\"description\":\"Subtitle text returned for the cited source item.\"},\"content\":{\"type\":\"string\",\"description\":\"Content text returned for the cited source item.\"},\"note_type\":{\"type\":\"string\",\"description\":\"Reported note type for the cited source item.\"},\"text_link\":{\"type\":\"string\",\"description\":\"Link returned for the cited source item.\"},\"time\":{\"type\":\"string\",\"description\":\"Display text for the source time. It can contain a date or relative time.\"},\"like\":{\"type\":\"integer\",\"description\":\"Reported like count for the cited source item.\"},\"user_id\":{\"type\":\"string\",\"description\":\"Source author identifier, which can be empty.\"},\"nick_name\":{\"type\":\"string\",\"description\":\"Display name returned for the source author.\"},\"avatar\":{\"type\":\"string\",\"description\":\"Avatar image URL returned for the source author.\"},\"image_list\":{\"type\":\"array\",\"description\":\"Images returned with the cited source item.\",\"items\":{\"type\":\"object\",\"description\":\"One image returned with the cited source item.\",\"properties\":{\"file_id\":{\"type\":\"string\",\"description\":\"File identifier for this source image.\"},\"width\":{\"type\":\"integer\",\"description\":\"Reported width of the source image.\"},\"height\":{\"type\":\"integer\",\"description\":\"Reported height of the source image.\"},\"url\":{\"type\":\"string\",\"description\":\"URL returned for the source image.\"},\"url_large\":{\"type\":\"string\",\"description\":\"Large image URL returned for the source image.\"}}}},\"video\":{\"type\":\"object\",\"description\":\"Video information when provided for the cited source item.\",\"properties\":{\"url\":{\"type\":\"string\",\"description\":\"Video media URL returned with the cited source item.\"},\"width\":{\"type\":\"integer\",\"description\":\"Reported width of the source video.\"},\"height\":{\"type\":\"integer\",\"description\":\"Reported height of the source video.\"}}}}}},\"share_info\":{\"type\":\"object\",\"description\":\"Display information for sharing the answer.\",\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"Title returned in the share information.\"},\"subtitle\":{\"type\":\"string\",\"description\":\"Subtitle returned in the share information.\"},\"content\":{\"type\":\"string\",\"description\":\"Share text returned for the answer.\"},\"image\":{\"type\":\"string\",\"description\":\"Image URL returned in the share information.\"},\"link\":{\"type\":\"string\",\"description\":\"Share link returned for the answer.\"},\"page_link\":{\"type\":\"string\",\"description\":\"Answer page link returned in the share information.\"},\"topic_id\":{\"type\":\"string\",\"description\":\"Topic identifier returned in the share information.\"},\"topic_ids\":{\"type\":\"array\",\"description\":\"Additional topic identifiers returned in the share information.\",\"items\":{\"type\":\"string\",\"description\":\"One identifier from the returned topic list.\"}}}}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Invalid request parameters or body\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Invalid or inactive access token\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Permission denied\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Request rate or daily quota limit exceeded\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Internal server error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Service temporarily unavailable\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"Global production API (default)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/xiaohongshu/ask-dots\"")' />

<p>Queries Xiaohongshu (RedNote) Ask Dots AI with a keyword question. Use it to retrieve an AI answer for topic research and question exploration.</p>

## Parameters

<div class="api-doc-table api-doc-table--params">

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | Yes | - | Access token for this API service. |
| <code>keyword</code> | query | <code>string</code> | Yes | - | Question or keyword to submit to Ask Dots AI. |

</div>

## Code Samples

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/xiaohongshu/ask-dots?token=YOUR_API_KEY&keyword=VALUE'
```

```text [🤖 AI Prompt]
I want to use the "Ask Dots AI" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/xiaohongshu/ask-dots?token=YOUR_API_KEY&keyword=VALUE
API Endpoint: BASE_URL + /api/xiaohongshu/ask-dots?token=YOUR_API_KEY&keyword=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/xiaohongshu-rednote/ask-dots-ai-en.json

Parameters:
- token (query): Access token for this API service. (Required)
- keyword (query): Question or keyword to submit to Ask Dots AI. (Required)

Return format: safely handle JSON or text according to the actual Content-Type.

Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
3. Business Code Reference:
   - 0: Success
   - 100: Invalid or Inactive Token
   - 301: Collection Failed. Please Retry.
   - 302: Rate Limit Exceeded
   - 303: Daily Quota Exceeded
   - 400: Invalid Parameters
   - 500: Internal Server Error
   - 600: Permission Denied
   - 601: Insufficient Balance
   - 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.

Please help me write a script in my preferred programming language to call this API and handle the response.
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Provided by OpenAPI servers

url = BASE_URL + "/api/xiaohongshu/ask-dots?token=YOUR_API_KEY&keyword=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
```

```js [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/xiaohongshu/ask-dots?token=YOUR_API_KEY&keyword=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
```

```java [☕ Java]
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
        final String url = BASE_URL + "/api/xiaohongshu/ask-dots?token=YOUR_API_KEY&keyword=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
```

```go [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/xiaohongshu/ask-dots?token=YOUR_API_KEY&keyword=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
```

```php [🐘 PHP]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/xiaohongshu/ask-dots?token=YOUR_API_KEY&keyword=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/xiaohongshu-rednote/ask-dots-ai-en.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[OpenAPI Definition (JSON)]</a>
</div>

## Response Fields

Key fields in a successful response (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Field path | Type | Description |
| --- | --- | --- |
| <code>data</code> | <code>object &#124; null</code> | Answer returned by Xiaohongshu Ask Dots, with answer elements and source items when provided. |
| <code>data.answer_status</code> | <code>integer</code> | Reported status code for the generated answer. |
| <code>data.has_more_sources</code> | <code>boolean</code> | Whether the answer reports additional source items beyond those returned here. |
| <code>data.base_info</code> | <code>object</code> | Display information and source counts for the answer. |
| <code>data.base_info.id</code> | <code>string</code> | Answer identifier returned as text. |
| <code>data.base_info.long_id</code> | <code>integer</code> | Numeric identifier returned with the answer. This integer can exceed the JavaScript safe integer range. |
| <code>data.base_info.note_title</code> | <code>string</code> | Title returned in the answer information. |
| <code>data.base_info.text</code> | <code>string</code> | Display text returned with the answer information. |
| <code>data.base_info.nickname</code> | <code>string</code> | Display name returned with the answer. |
| <code>data.base_info.avatar</code> | <code>string</code> | Avatar image URL returned with the answer. |
| <code>data.base_info.dark_avatar</code> | <code>string</code> | Avatar image URL for dark display, when provided. |
| <code>data.base_info.total_count</code> | <code>integer</code> | Source count reported with the answer. It can exceed the number of source items returned. |
| <code>data.base_info.totalCnt</code> | <code>string</code> | Source count label as display text. The label can contain words. |
| <code>data.base_info.source_avatars</code> | <code>array</code> | Avatars returned for sources shown with the answer. |
| <code>data.base_info.source_avatars[]</code> | <code>string</code> | Avatar image URL for one displayed source. |
| <code>data.elements</code> | <code>array</code> | Content blocks in the generated answer. |
| <code>data.elements[]</code> | <code>object</code> | One answer block. Its content fields depend on the block type. |
| <code>data.elements[].element_type</code> | <code>string</code> | Type label reported for the answer block. |
| <code>data.elements[].markdown</code> | <code>object</code> | Markdown content for this answer block. |
| <code>data.elements[].markdown.text</code> | <code>string</code> | Generated Markdown text for this answer block. |
| <code>data.elements[].image</code> | <code>object</code> | Images included in this answer block. |
| <code>data.elements[].image.image_list</code> | <code>array</code> | Image entries for the answer block. |
| <code>data.elements[].image.image_list[]</code> | <code>object</code> | One image included in the answer block. |
| <code>data.elements[].image.image_list[].file_id</code> | <code>string</code> | File identifier for this answer image. |
| <code>data.elements[].image.image_list[].width</code> | <code>integer</code> | Reported width of the answer image. |
| <code>data.elements[].image.image_list[].height</code> | <code>integer</code> | Reported height of the answer image. |
| <code>data.elements[].image.image_list[].url</code> | <code>string</code> | URL returned for the answer image. |
| <code>data.elements[].image.image_list[].url_size_large</code> | <code>string</code> | Large image URL returned for the answer image. |
| <code>data.elements[].image.image_list[].source_avatar</code> | <code>string</code> | Source avatar URL returned with the answer image. |
| <code>data.elements[].image.image_list[].source_nickname</code> | <code>string</code> | Source display name returned with the answer image. |
| <code>data.elements[].image.image_list[].user_id</code> | <code>string</code> | User identifier returned with the answer image. |
| <code>data.elements[].spark</code> | <code>object</code> | Answer block that can contain highlighted Markdown. |
| <code>data.elements[].spark.data</code> | <code>object</code> | Highlight content for this answer block. |
| <code>data.elements[].spark.data.highlight_markdown</code> | <code>string</code> | Highlighted Markdown returned for this answer block. |
| <code>data.items</code> | <code>array</code> | Source items returned for the answer. |
| <code>data.items[]</code> | <code>object</code> | One cited source item. Available fields vary by source. |
| <code>data.items[].id</code> | <code>string</code> | Reported source item identifier. Its form can vary by source. |
| <code>data.items[].title</code> | <code>string</code> | Title of the cited source item. |
| <code>data.items[].subtitle</code> | <code>string</code> | Subtitle text returned for the cited source item. |
| <code>data.items[].content</code> | <code>string</code> | Content text returned for the cited source item. |
| <code>data.items[].note_type</code> | <code>string</code> | Reported note type for the cited source item. |
| <code>data.items[].text_link</code> | <code>string</code> | Link returned for the cited source item. |
| <code>data.items[].time</code> | <code>string</code> | Display text for the source time. It can contain a date or relative time. |
| <code>data.items[].like</code> | <code>integer</code> | Reported like count for the cited source item. |
| <code>data.items[].user_id</code> | <code>string</code> | Source author identifier, which can be empty. |
| <code>data.items[].nick_name</code> | <code>string</code> | Display name returned for the source author. |
| <code>data.items[].avatar</code> | <code>string</code> | Avatar image URL returned for the source author. |
| <code>data.items[].image_list</code> | <code>array</code> | Images returned with the cited source item. |
| <code>data.items[].image_list[]</code> | <code>object</code> | One image returned with the cited source item. |
| <code>data.items[].image_list[].file_id</code> | <code>string</code> | File identifier for this source image. |
| <code>data.items[].image_list[].width</code> | <code>integer</code> | Reported width of the source image. |
| <code>data.items[].image_list[].height</code> | <code>integer</code> | Reported height of the source image. |
| <code>data.items[].image_list[].url</code> | <code>string</code> | URL returned for the source image. |
| <code>data.items[].image_list[].url_large</code> | <code>string</code> | Large image URL returned for the source image. |
| <code>data.items[].video</code> | <code>object</code> | Video information when provided for the cited source item. |
| <code>data.items[].video.url</code> | <code>string</code> | Video media URL returned with the cited source item. |
| <code>data.items[].video.width</code> | <code>integer</code> | Reported width of the source video. |
| <code>data.items[].video.height</code> | <code>integer</code> | Reported height of the source video. |
| <code>data.share_info</code> | <code>object</code> | Display information for sharing the answer. |
| <code>data.share_info.title</code> | <code>string</code> | Title returned in the share information. |
| <code>data.share_info.subtitle</code> | <code>string</code> | Subtitle returned in the share information. |
| <code>data.share_info.content</code> | <code>string</code> | Share text returned for the answer. |
| <code>data.share_info.image</code> | <code>string</code> | Image URL returned in the share information. |
| <code>data.share_info.link</code> | <code>string</code> | Share link returned for the answer. |
| <code>data.share_info.page_link</code> | <code>string</code> | Answer page link returned in the share information. |
| <code>data.share_info.topic_id</code> | <code>string</code> | Topic identifier returned in the share information. |
| <code>data.share_info.topic_ids</code> | <code>array</code> | Additional topic identifiers returned in the share information. |
| <code>data.share_info.topic_ids[]</code> | <code>string</code> | One identifier from the returned topic list. |

</div>

## Response Example

<ApiExampleSection :api='JSON.parse("\"/api/xiaohongshu/ask-dots\"")' />

