Skip to main content
Glama

get-36kr-trending

Retrieve trending news and insights on startups, business, and technology from 36Kr. Access real-time rankings for investment trends, industry analysis, and innovation updates.

Instructions

获取 36 氪热榜,提供创业、商业、科技领域的热门资讯,包含投融资动态、新兴产业分析和商业模式创新信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNo分类hot

Implementation Reference

  • The tool handler function: parses input args, performs HTTP POST request to 36Kr API endpoint based on type, processes the response data, and maps it to a structured output array of trending items.
    func: async (args) => { const { type } = get36krRequestSchema.parse(args); const resp = await http.post<{ data: Record<string, any[]>; }>( `https://gateway.36kr.com/api/mis/nav/home/nav/rank/${type}`, { partner_id: 'wap', param: { siteId: 1, platformId: 2, }, timestamp: Date.now(), }, { headers: { 'Content-Type': 'application/json; charset=utf-8', }, }, ); return resp.data.data[LIST_TYPE_MAP[type]].map((item) => { const data = item.templateMaterial; return { title: data.widgetTitle, cover: data.widgetImage, author: data.authorName, publish_time: dayjs(data.publishTime).toISOString(), read_count: data.statRead, collect_count: data.statCollect, comment_count: data.statComment, praise_count: data.statPraise, link: `https://www.36kr.com/p/${data.itemId}`, }; }); },
  • Zod input schema defining the 'type' parameter for the tool, with options for different trending lists and default to 'hot'.
    const get36krRequestSchema = z.object({ type: z .union([ z.literal('hot').describe('人气榜'), z.literal('video').describe('视频榜'), z.literal('comment').describe('热议榜'), z.literal('collect').describe('收藏榜'), ]) .optional() .default('hot') .describe('分类'), });
  • Tool registration using defineToolConfig, specifying the name 'get-36kr-trending', description, input schema, and handler function.
    export default defineToolConfig({ name: 'get-36kr-trending', description: '获取 36 氪热榜,提供创业、商业、科技领域的热门资讯,包含投融资动态、新兴产业分析和商业模式创新信息', zodSchema: get36krRequestSchema, func: async (args) => { const { type } = get36krRequestSchema.parse(args); const resp = await http.post<{ data: Record<string, any[]>; }>( `https://gateway.36kr.com/api/mis/nav/home/nav/rank/${type}`, { partner_id: 'wap', param: { siteId: 1, platformId: 2, }, timestamp: Date.now(), }, { headers: { 'Content-Type': 'application/json; charset=utf-8', }, }, ); return resp.data.data[LIST_TYPE_MAP[type]].map((item) => { const data = item.templateMaterial; return { title: data.widgetTitle, cover: data.widgetImage, author: data.authorName, publish_time: dayjs(data.publishTime).toISOString(), read_count: data.statRead, collect_count: data.statCollect, comment_count: data.statComment, praise_count: data.statPraise, link: `https://www.36kr.com/p/${data.itemId}`, }; }); }, });
  • Mapping object that translates input 'type' values to corresponding API list keys used in the response data access.
    const LIST_TYPE_MAP: Record<z.infer<typeof get36krRequestSchema>['type'], string> = { hot: 'hotRankList', video: 'videoList', comment: 'remarkList', collect: 'collectList', };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/baranwang/mcp-trends-hub'

If you have feedback or need assistance with the MCP directory API, please join our Discord server