#sideko #news #hacker #api-bindings #hacker-news #hacker-news-api

sideko_hacker_news

Rust API bindings - ssideko_hacker_news

2 unstable releases

0.2.0 Dec 1, 2023
0.1.0 Oct 12, 2023

#7 in #hacker-news

Download history 1/week @ 2023-11-04 2/week @ 2023-11-11 3/week @ 2023-11-18 35/week @ 2023-11-25 11/week @ 2023-12-02 2/week @ 2023-12-09 3/week @ 2023-12-16 4/week @ 2023-12-23 2/week @ 2023-12-30 1/week @ 2024-01-13 4/week @ 2024-01-27 7/week @ 2024-02-10 45/week @ 2024-02-17

56 downloads per month

MIT license

24KB
446 lines

sideko_hacker_news rust

Hacker News makes the public their data available in near real time.

The v0 API is essentially a dump of our in-memory data structures. We know, what works great locally in memory isn't so hot over the network. Many of the awkward things are just the way HN works internally... It's not the ideal public API, but it's the one we could release in the time we had

This documentation and SDK libraries have been generated by Sideko which has no affiliation with Hacker News. Everything you see is generated from an OpenAPI specification.

Install and try the free beta SDK generator on our Github.

Authentication

use sideko_hacker_news::Client;
let client = Client::default();

get_ask_story_ids

List the latest Ask HN story IDs. Will return maximum 200 IDs.

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_ask_story_ids(GetAskstoriesJsonRequest {..Default::default()});

get_best_story_ids

List the best hacker news story IDs. Will return maximum 500 IDs.

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_best_story_ids(GetBeststoriesJsonRequest {..Default::default()});

get_item

Stories, Comments, Jobs, Ask HNs and even Polls are all considered items, with slightly different structures (see the examples).

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_item(GetItemIdJsonRequest {id: 123, ..Default::default()});

get_job_story_ids

List the latest Job story IDs. Will return maximum 200 IDs.

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_job_story_ids(GetJobstoriesJsonRequest {..Default::default()});

get_max_item_id

The current largest item ID. Walking backwards from here allows you to list all items avialable through the API.

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_max_item_id(GetMaxitemJsonRequest {..Default::default()});

get_new_story_ids

List the top hacker news story IDs. Will return maximum 500 IDs.

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_new_story_ids(GetNewstoriesJsonRequest {..Default::default()});

get_show_story_ids

List the latest Show HN story IDs. Will return maximum 200 IDs.

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_show_story_ids(GetShowstoriesJsonRequest {..Default::default()});

get_top_story_ids

List the top hacker news story IDs. Will return maximum 500 IDs.

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_top_story_ids(GetTopstoriesJsonRequest {..Default::default()});

get_updates

List recently updated item IDs and profile IDs.

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_updates(GetUpdatesJsonRequest {..Default::default()});

get_user

Retrieves user metadata given the user ID (HN username).

Documentation & SDKs generated by Sideko from OpenAPI. Install and try the free beta SDK generator on our Github.


let response = client.get_user(GetUserIdJsonRequest {id: "string".to_string(), ..Default::default()});

Dependencies

~4–18MB
~261K SLoC