laarctags | new | comments | ask | show | place | submit | xojoc's threadslogin
2 points by xojoc 325 days ago | parent | on: Laarc API

Thanks Shawn. For context this API is very similar to the Hacker News one: In fact it took minutes to add it to my own site (

@shawn: I just noticed that the API doesn't export the "tags" of a submission. For example the JSON for this submission missises the tags "meta,laarc,api,programming". Do you think it would be a lot of trouble to export them?


2 points by shawn 324 days ago

A surprising oversight on my part. Let me look into it when I’m not juggling a job and a puppy.

Since it’s the first feature request in a year, I’d feel bad not doing it. So let’s see if it happens.


2 points by shawn 323 days ago

I haven't updated the API docs yet, but items now export tags. And since it's 5am, I'd rather leave a quick note here on how to get them.

Here's what looks like:

    "by" : "rain1",
    "descendants" : 0,
    "id" : 2545,
    "keys" : [ "nokill", "/l/electronics" ],
    "score" : 2,
    "text" : "",
    "time" : 1610283131,
    "title" : "Why three prongs?  Electrical ground, stray voltage",
    "type" : "story",
    "url" : ""
To get the tags, use this algorithm:

1. Check whether there's a "keys" entry. If not, return an empty list.

2. Remove all keys that don't begin with a forward slash, then return the list.

I'll explain in more detail why I chose this approach. But for now, just know that you get more information this way. (e.g. you can see whether a story is flagged by checking for the "flagged" key.)


Welcome | Guidelines | Bookmarklet | Feature Requests | Source | API | Contact | Twitter | Lists

RSS (stories) | RSS (comments)