Skip to content

[Feature Request] Add language parameter to /v1/tool/search-narrative-candidates #103

@BRAYC1330

Description

@BRAYC1330

Situation

The endpoint /v1/tool/search-narrative-candidates does not support a language query parameter. As a result, keyword searches return mixed-language results (often predominantly Chinese), regardless of the client's locale.

This breaks i18n for bots, dashboards, and apps that expect English-only (or locale-specific) results.

Expected Behavior

Add a language parameter matching the behavior of /v1/tool/list-trending-topics:

- name: language
  in: query
  description: 'Filter results by language/locale. Affects tokenization and trend definition.'
  required: false
  schema:
    type: string
    enum: [zh, en, ko]
    default: en
  example: en

Current Workaround
Clients must post-filter results by detecting Latin characters or using language-detection libraries. This is inefficient and error-prone.
Why This Matters

Enables reliable English-only keyword search for non-CN users
Critical for automated tools (bots, analytics dashboards) that consume this API
Aligns with existing /list-trending-topics?language=en pattern — consistency improves DX

Reference

Endpoint with language support: /v1/tool/list-trending-topics
OpenAPI spec location: chainbase-labs/chainbase-docs/api-reference/tops-api/publicapi.yaml

Impact

Breaking change
Backward compatible (new optional param)
Requires migration

Thanks for maintaining this awesome API!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions