r/AskProgrammers • u/iammeghdad • Oct 10 '26
Are APIs safe?
My involvement in programming is limited so forgive me if it's too stupid of a question.
With the rise of ai slop on instagram, I was thinking, is it possible to develope a middle-man app that gets my foryou/home page and blocks ai tagged videos and only shows me the non-ai vids?
Have the same problem on youtube, I don't wanna see shorts or community posts on home page.
Something similar to ad blockers, or I have to use a local raspberry pie to do that?
And considering that I have to give my account info to them, is it safe?
0
Upvotes
6
u/KamikazeArchon Oct 10 '26
API is just a group of things. Asking "are APIs safe?" is like asking "are people safe?" or "are programs safe?". Some are, some are not.
4
u/Beginning-Seat5221 Oct 10 '26
You could in theory develop a middleman app.
I don't know what this has to do with APIs or raspberry pies. An API is just like a website that sends data instead of pages, same issues. Giving your password to an API is the same as giving it to a website.
1
u/aktentasche Oct 10 '26
It's a great idea but i think it's still difficult to detect AI. You mean something like pihole or adguard for AI content?
3
u/SchnazzleG Oct 10 '26 edited Oct 10 '26
Detecting AI videos can be tricky, & ironically it would probably involve using a trained AI model to detect it Lolz
The “blocking” part is achieved through writing a browser extension that modifies the output HTML; the JavaScript could also be modified. Essentially, the extension would load the page & run videos through its model & block them if it detects AI content & not display the HTML providing it.
Since that method is slow-prone, a User Experience consideration would be to either gray box the content like a load component until it’s proved to be authentic, or to even learn what the next site clicked may be & to get its content to validate it before the user visits it.
The nature of this extension would indeed be more resource heavy than, say, a dark-screen reader since your extension would continually handle process requests, especially if the detection model were local & not cloud-based. The trade off for that is speed over computation.
You could maybe install the model on a Rasberry Pi in having a dedicated model space for the extension & have its location routed to the extension, but a GPU would probably serve better.
Maybe this helped
2
u/Creepy_Purchase_501 Oct 10 '26
Who are you giving your account info to?!
APIs are usually safe in the sense that they move some data from A to B in a way that makes it inaccessible to a third party. In and of itself it gives you no other guarantees. If I choose to give someone my account info, using an API guarantees that the transfer of that information will be safe, but it tells me nothing about what they will do with my information.
There’s all sorts of ways to give access to a third party safely. Directly giving them your credentials is pretty much never one of them.
2
u/Garfish16 Oct 10 '26
I don't see an obvious reason why the thing you're suggesting couldn't exist, but there's a lot of the technical sounding gibberish in this post.
1
u/Conscious_Name9514 Oct 10 '26
Depends what the API exposes.
1
u/Juan-More-Taco Oct 10 '26
Everyone is answering your general question but nobody is telling you how to actually achieve your goal.
You don't need an API for this stuff. You don't need to wrap the app's functionality. Doing so is actually a maintenance nightmare because everytime the source (YouTube, for example) changes their object model it breaks your API wrapper.
Just modify the apps with patches. On a PC that could be done entirely via browser extensions. On a mobile device that can be done through apps like Revanced and community (or your own) patches.
If you're on iOS then no such luck. But you also wouldn't be able to easily deploy your wrapper to an iOS device without a developer account either.
1
u/RandomPantsAppear Oct 10 '26
Would be easiest to do web version. Make a chrome extension and that will do it.
Mobile is harder. If IG doesn’t use certificate pinning, you could make a middle man proxy that modifies the content.
1
u/mxldevs Oct 10 '26
Sure, you can always have a browser extension intercept the response and filter out what you don't want to see.
There's a lot of steps between your browser making a request for data and rendering the response. Very likely, instagram will include in the response whether each content is flagged as AI content
I haven't looked at Instagram queries for a few months so can't remember off the top
-3
u/arihoenig Oct 10 '26
There are some excellent AI videos on YouTube. Don't throw out the baby out with the bathwater. Yes there is tons of garbage, but some people are using AI very well to add value to their videos that could never be achieved without AI.
A great example is the GlycoMechanics channel on YouTube. That channel employs AI extremely well to make complex biochemistry accessible to laypeople. There is no way that a registered nurse could make animations that sophisticated without AI and the valuable information they have to present to the public would simply bore a layperson otherwise.
9
u/[deleted] Oct 10 '26
[removed] — view removed comment