Viki

Viki 写东西的地方

努力上进且优秀
github
email
x
steam
bilibili
douban

Understand the world in 60 seconds a day API

Background#

Recently, I was quite keen on playing with QQ bots and often looked for some third-party APIs to integrate data, using the oicq protocol library to implement some simple yet meaningful functions, just to have some fun with group friends.

A representative example is "Understand the World in 60 Seconds a Day." Every day, there are about ten short hot news articles; although the function is simple, the content is quite meaningful, especially for kids like us who never read the news.

Why Do It Myself#

Unfortunately, many websites' API services are not stable enough, sometimes going downor just disappearing. So I did a Google search and found that the vast majority of data sources for these interfaces point to this Understand the World in 60 Seconds a Day column on Zhihu.

How It Was Done#

After a series of vigorous operations (to put it simply, it was just a simple JSON GET request, with no encryption, cross-domain, or request header restrictions, just hit F12 and the interface pops up), I found its column data interface:

https://www.zhihu.com/api/v4/columns/c_1261258401923026944/items

The optional parameters for this API URL are:

  • limit Number of data items returned
  • offset Pagination parameter

After obtaining the data, to quickly create a high-performance, low-latency API with caching, I chose deno and deployed it using Deno Deploy, setting it to return only the day's data for each request. Additionally, I set up request caching, meaning that only one request is sent to Zhihu each day; starting from the second request, it directly uses the cache, speeding up the API response time while reducing the pressure on Zhihu's servers.

How to Use This Thing#

Here’s a deployed API address that you can use directly~

Update 2024.7#

The v2 format version has been released, standardizing the JSON return. Welcome to use:
https://60s.viki.moe?v2=1

The source code can be found at vikiboss/60s - GitHub, feel free to deploy it yourself or star~

Update 2025.2#

60s API V2 (https://60s-api.viki.moe) has been officially released.

  • Added more practical and interesting interfaces
  • Improved API documentation: Apifox
  • Supports deployment via Docker, Deno, Bun, Node.js, and more

Please note that the v1 version stopped updating on 2025/1/15, and is on the v1-legacy branch. Please migrate to the v2 version as soon as possible; the v1 version will completely stop service on 2025/6/31, at which point the domain will switch to the v2 version.

The source code can be found at vikiboss/60s - GitHub, feel free to star~

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.