DailyHotApi
repository·master·Indexed 26 days ago
https://github.com/imsyy/dailyhotapiAn aggregator API that provides trending data from multiple Chinese social media, news, and gaming platforms in JSON and RSS formats. It supports a wide range of sources including Bilibili, Weibo, Zhihu, Douyin, and GitHub. The project can be integrated into Node.js applications via the dailyhot-api package or deployed using Docker, PM2, Vercel, Railway, and Zeabur.
What's inside dailyhot-api
- DailyHotApi is an API service that aggregates trending data from various platforms. It provides fast response times and supports both RSS and JSON formats. It is designed to be easily extensible with a simple routing directory for adding new data sources.
One-click deployment platforms
masterThe project supports one-click deployment on several cloud platforms. For most of these, you should first fork the repository to your own account to enable the deployment process.
- Vercel: Use the Vercel deployment button or visit the dedicated Vercel repository.
- Railway: Fork the repository and use the Railway one-click deploy feature.
- Zeabur: Fork the repository and use the Zeabur one-click deploy feature.
Deploy using PM2
masterYou can use PM2 for process management. Ensure PM2 is installed globally before running the deployment script.
npm i pm2 -g sh ./deploy.shUse dailyhot-api in a Node.js application
masterYou can integrate
dailyhot-apidirectly into your Node.js project by installing the package and callingserveHotApi.Note: Using this method may prevent access to certain interfaces that require a Puppeteer environment.
pnpm add dailyhot-apiimport serveHotApi from "dailyhot-api"; /** * Start the server * @param {Number} [port] - Port number * @returns {Promise<void>} */ serveHotApi(3000);Deploy using Docker
masterYou can deploydailyhot-apiusing Docker by either building from the local source or pulling the official image from Docker Hub.Manual deployment from source
masterTo deploy manually on your own machine or server, follow these steps:
- Clone the repository and enter the directory.
- Install dependencies using
npm install. - Copy
/.env.exampleto/.envand configure your settings. - Run in development mode with
npm run devor build and start withnpm run build && npm run start.
Deploy DailyhotApi using Docker Compose
masterYou can deploy the
DailyhotApiservice using Docker Compose. By default, the service maps port6688on the host to port6688in the container and persists logs to a local./logsdirectory. The service is configured to run as user114514and will automatically restart if it fails.version: "3.8" services: DailyhotApi: build: context: . target: runner ports: - "6688:6688" volumes: - "./logs:/app/logs" environment: - PORT=6688 user: "114514" restart: alwaysConfigure PM2 deployment with ecosystem.config.cjs
masterThe project uses a PM2 ecosystem configuration file to manage the application process. You can customize the application name, port, and environment variables by modifying
ecosystem.config.cjsbefore deploying with PM2.module.exports = { apps: [{ name: 'daily-news', script: 'npm', args: 'start', instances: 1, autorestart: true, watch: false, max_memory_restart: '1G', env: { NODE_ENV: 'development', PORT: 6688 } }] }Configure DailyhotApi via Environment Variables
masterWhen deploying via Docker or Docker Compose, you can control the application's listening port using the
PORTenvironment variable.environment: - PORT=6688Configure dailyhot-api via environment variables
masterThe
dailyhot-apiproject is configured using environment variables. You can set these in a.envfile or directly in your deployment environment. The application usesdotenvto load these values.Below is the complete list of available configuration keys, their default values, and their types:
Important usage notes and caching
masterTo avoid frequent requests to official data sources, the project implements a default cache of 60 minutes. If you need to change this behavior, you must modify the configuration in your
.envfile.Warning: Some interfaces use web scrapers. Ensure your usage complies with the rules of the target websites.
Reference of available API endpoints
masterThe API provides endpoints for various platforms. Each endpoint is accessed via a specific identifier. Below is a list of available data sources and their corresponding call names:
Platform Category Call Name Bilibili Hot List bilibiliAcFun Rankings acfunWeibo Hot Search weiboZhihu Hot List zhihuZhihu Daily Recommended zhihu-dailyBaidu Hot Search baiduDouyin Trending douyinKuaishou Trending kuaishouDouban Movie New Releases douban-movieDouban Group Discussion douban-groupTieba Trending tiebaSspai Hot List sspaiIT Home Hot List ithomeIT Home (Xijiayi) Latest ithome-xijiayiJianshu Recommended jianshuGuokr Popular Articles guokrThe Paper Hot List thepaperToutiao Hot List toutiao36Kr Hot List 36kr51CTO Recommended 51ctoCSDN Rankings csdnNodeSeek Latest nodeseekJuejin Hot List juejinQQ News Trending qq-newsSina Hot List sinaSina News Trending sina-newsNetEase News Trending netease-news52pojie Lists 52pojieHostloc Lists hostlocHuxiu 24 Hours huxiuCoolapk Hot List coolapkHupu Street Hot Posts hupuIfanr News Flash ifanrLeague of Legends Update Announcements lolMiyoushe Latest News miyousheGenshin Impact Latest News genshinHonkai Impact 3rd Latest News honkaiHonkai: Star Rail Latest News starrailWeChat Reading Rising List wereadNGA Hot Posts ngabbsV2EX Topic List v2exHelloGitHub Trending hellogithubWeather Alarm National Weather Warnings weatheralarmEarthquake Station Earthquake Reports earthquakeToday in History Month-Day history