8 ms·
but you can access every single shitpost from the website, so why not from API? it's lighter
by 11235813213455 3y ago
but you can access every single shitpost from the website, so why not from API? it's lighter
- kohlerm 3y agoBecause others use automatic ways to retrieve the data and derive value from it without paying anything
- interactivecode 3y agoIf reddit did that from the start we wouldn’t be in this situation in the first place?
- David_Axelrod 3y agoMost of the time you dont just expose your internal api routes to the world. You need to write curated public facing routes that dont include certain schema or records. Takes time to write and maintain that different set of endpoints
- TheCoreh 3y agoThese are already written and fully functional, and Reddit has essentially been a non-moving target in terms of features since ~2016, when they added first-party image hosting.
- chc 3y agoReddit actually has added a couple of features since then (e.g. polls), but they just didn't update the API to deal with those, so the API still remained completely stable.
- TeMPOraL 3y agoNot really. Your HTML is, quite literally, a degenerate form of an API. The simplest way to offer a content API is to offer an alternative endpoint that serves the same stuff as your normal one, except without all the bullshit (er, beautifully design, interactive frontend).
- David_Axelrod 3y agoDon't mind the other commentor, spirited discussion is always welcome! I was thinking about this and even hacker news is a good example of how an html view can differ from data model. Hacker news doesn't show you the vote count of every comment despite having that data available. They chose to not even render it into the template so no scraper will ever have access to that information.
- thulesgold 3y agoAny issue with Reddit offering a API only to not maintain it, or uphold any sort of SLA uptime, or not worry about releasing breaking changes every week? Having a public facing API is not trivial or cost free.
- TeMPOraL 3y ago> Reddit offering a API only to not maintain it If they were to offer an API that's just HTML of the website (old.reddit.com specifically, not the new one) but without the cruft that makes for 90% of the markup of a human-facing page, and which exists only to hang styles and scripts off... why wouldn't they maintain it? It's literally the same as what the browser gets, but without the bullshit. > or uphold any sort of SLA uptime Do they uphold any sort of SLA uptime for the webpage itself? The simplest API would be just the meat of the website, so it couldn't possibly be less reliable than the site itself. > not worry about releasing breaking changes every week? Reddit is a stable site. Like most social media platforms, they don't release breaking changes often (they do screw with DOM element ids and CSS classes all the time, but that is to make life harder for ad blockers, which is another topic). Sure, some things may move around, be added or removed - but this is webshit we're talking about. You can't truly rely on any API to have a stable, or well-defined structure[0] - so people are already used to treating schemas as open-ended[1] and keeping up with their changes. > Having a public facing API is not trivial or cost free. Sure. But I'm trying to establish a lower bound here, and it's clear that this is much lower costs and effort than maintaining the human-facing website itself. And I mean, remember the whole "semantic HTML" and "microformats" trends of yore? Or how HTML5 came to be, with all those tags like <em> and <section> and <article>? The whole point of that was to make HTML work as both rendering markup and machine-readable API. Consider also that the alternative isn't no public API - it's scraping. So if your public API is somehow more expensive to serve or maintain than either the website itself, or a decluttered version of it, then you're doing something wrong. -- [0] - Don't get me started on the disaster that is Swagger/OpenAPI. [1] - Something Clojure coding philosophy makes explicit: you pass around maps and arrays, you read and write the keys you know about, and stuff you don't recognize you ignore and pass without changing.
- awestroke 3y agoBecause you can't include ads in an API response
- jurimasa 3y agoYet.
- jodrellblank 3y agoWhy can’t you? “Sent from my iPhone.”
- awestroke 3y agoAny time I see "Sent from my iPhone" I assume the sender is a fool
- jodrellblank 3y agoAre you missing the point that adverts can be inline with normal content and therefore can be included in an API result?
- kpw94 3y agoYou could, but with EU and other legislations you'd have to make it clear it's an ad, so in API-speak, there'd be a "is_sponsored=true". That makes it too easy for API consumers to ignore. (Compared to human eyeballs browsing a webpage) But you could make it part of the ToS: if you're using the API to present posts to users, you MUST show all the posts in the list, including the is_sponsored=true ones.
- jodrellblank 3y agoThat's a good point, UK Government page on "Guidance: Hidden ads: Being clear with your audience": https://www.gov.uk/government/publications/social-media-endorsements-guide-for-influencers/social-media-endorsements-being-transparent-with-your-followers https://www.gov.uk/government/publications/social-media-endo...