7 ms·
Building an API in 60 seconds, without any server setup
- jacquesc 12y agoAnyone know if this would work with Mailguns cool email signature parsing library? http://blog.mailgun.com/open-sourcing-our-email-signature-parsing-library/ http://blog.mailgun.com/open-sourcing-our-email-signature-pa... as in, easily build an api for it?
- hackerews 12y agoThis is an awesome usecase! All it needs is the 'talon' python library to work? If so, I'll add support for talon right now. PS - to see the libraries we currently support, check out: https://api.blockspring.com/documentation https://api.blockspring.com/documentation
- blockspring 12y agoTalon is now supported. Feel free to make all the cool mailgun api's you want!
- voltagex_ 12y agoMaybe the paid version of your site could support virtualenvs.
- hackerews 12y agoSuper curious, what would you use the virtualenv for? Each script run happens in its own container. Is it to import your own libraries that we don't support yet?
- voltagex_ 12y ago> Is it to import your own libraries that we don't support yet? Yeah. I don't have a use for this as-yet but I can see organisations wanting to import their preconfigured envs in.
- koesterd 12y agoI just reported a urgent bug via the feedback form because I couldn't find your email. Please pay attention to it!
- hackerews 12y agoThanks for the report! We scrap down the docker container on each api run - so it shouldn't be a problem.
- xmonkee 12y agoCare to give us a peek at how this works?
- jkfoling 12y agoAlso interested in how this works. Maybe the author can give some details how he set up the service.
- grimtrigger 12y agoInteresting. Whats a use case for this?
- donpinkus 12y agoI needed to do screenshots in my Rails app, and I couldn't get the screen shotting service to work in Ruby. I already knew how to do screenshots in Python, and was tired of relearning this stuff in a different language for each project. So I made an API that takes a screenshot, and now I don't need to learn it ever again :) https://api.blockspring.com/users/mapsup/blocks/07b6410853fa5343076db5d742de58e7 https://api.blockspring.com/users/mapsup/blocks/07b6410853fa...
- hackerews 12y agoI personally like the google reverse image search hack :). I used to just run that python script manually on my computer. Now I can just call it from my front-end js when users upload images and return back some text about the image. https://api.blockspring.com/users/pkpp1233/blocks/5a1b66ef208007c51a45fda220dbe8db https://api.blockspring.com/users/pkpp1233/blocks/5a1b66ef20... But you can do just about anything. Users have done r statistics from js. Or python sentiment analyses (lots of good libraries there) whenever they get user comments in their rails app.
- makeee 12y agoWas just looking today if google had an api for reverse image search, which they don't, so thank you :)
- hmsimha 12y agoI imagine they have an undocumented api for reverse image search. The team at Google has released this extension[1] for adding reverse image search to the context menu, which is currently the only extension that enables reverse image search for images only accessible while logged in (think if you want to reverse image search a preview of an image someone emailed to you). I was thinking about intercepting the requests it makes and making an open source extension that does the same thing, but I haven't had the time yet. [1] https://chrome.google.com/webstore/detail/search-by-image-by-google/dajedkncpodkggklbegccjpmnglmnflm https://chrome.google.com/webstore/detail/search-by-image-by...
- joeyspn 12y agoThis is a really creative and interesting project... Will use it for sure
- hackerews 12y agoThank you! Let me know if I can help in any way... Paul@blockspring.com 3128347265
- rstoner 12y agoDear Github. Please buy these guys and enable this functionality for gists.
- JustARandomGuy 12y agoThis looks like a great service! Is there a way to sign up for a paid account or a credit system? I don't want to burden you guys with the costs of my API requests.
- hackerews 12y agoWe should do an Ask HN about this :). Would love your feedback on what makes most sense. People have messaged me asking for pricing tiers based on rate limits / usage, or purchasing company machines to run all apis from, or even paying for extra privacy (like on github). What's most fair / makes most sense for you?
- JustARandomGuy 12y agoTo be completely honest, I'm not sure. I would say charge by the total amount of time the VMs have run, but I have no idea how the costing will work out. Good luck!
- blockspring 12y agoThat's a great point. And since people aren't running dedicated machines, only paying for the requests that happen, it could even be cheaper than spinning up your own server. Interesting!
- mrstrawberry 12y agoAwesome service, can't wait to use this.
- hackerews 12y agoPeople have asked for Javascript and Perl. Any other languages you'd want me to add?
- alvare 12y agoHaskell
- codygman 12y agoIf Haskell were on there, I'd at least transliterate the Python example from the video as a contribution ;)
- innguest 12y agoAnother vote for Haskell.
- hackerews 12y agoLanguage support is super easy to add. Any list of libraries you'd really want with Haskell?
- lgas 12y agoIf it's easy, Clojure with support for arbitrary libraries via leiningen would be great :)
- innguest 12y agoPrelude's support libraries plus at least the curl package: https://hackage.haskell.org/package/curl https://hackage.haskell.org/package/curl
- codygman 12y agoSome random highly used libraries: containers, bytestring, mtl, text, transformers, time, array, aeson, split, blaze-builder, blaze-html lens, safe, resourcet I'm sure aeson examples would be very popular. mtl/transformers examples for those who are getting to them in the learning process. Here is a complete list of the top reverse dependencies for libraries on hackage: https://docs.google.com/spreadsheets/d/1o7K_tEDIULPHNv8RpP0E3p34V0FzMBfhnTfiMNrZg3o/edit?usp=sharing https://docs.google.com/spreadsheets/d/1o7K_tEDIULPHNv8RpP0E...
- eropple 12y agoSo my buddy Sean (@tilmonedwards) just built something pretty similar as a command-line app, just for yucks: https://github.com/seanedwards/svcizer https://github.com/seanedwards/svcizer
- tlrobinson 12y ago"The request body will be passed to stdin." "STDOUT and STDERR from cmd will be dumped to the response body." "HTTP headers and query parameters will be passed as environment variables." Uhhh, your friend just reinvented CGI: https://en.wikipedia.org/wiki/Common_Gateway_Interface https://en.wikipedia.org/wiki/Common_Gateway_Interface
- eropple 12y agoYeah--that's neat, to me. :-) I've written against CGI before. The kicker to me is that it converges back on what we'd already done. History is fun.
- superuser2 12y agoI'm not sure I understand what this is. Free hosted PaaS for single files, essentially? I know nothing about where the code is running? Is it performant? Is it reliable? How are they covering server costs / at what point would I be asked to pay, and how much?
- hackerews 12y agoHey superuser, Great questions. Let me answer them one at a time! Where is the code running? Every script run happens in its own sandbox on our machines. We use docker, it's awesome. People are asking for dedicated machines specifically for their company, and others are asking to hook into their own machines. Once we figure out how people/companies want to use the site, we'll put up some options for where code will be run. I'm totally open to feedback and would love to hear what you think. I'm measuring costs right now. But I'm seeing that when we get a fair pricing model up - if you could hit these api's only when you need them, rather than have a dedicated server for them, you'd save a money. A really different way of looking at PaaS + Apis... and I'm super excited about it. Right now, I'm just trying to collect as much awesome feedback as possible for use cases, and then we'll have a better idea for how users would want to be charged. Right now, people are asking for a simple request-based model. Would love your thoughts on this as well. Thanks again for the questions. You're awesome. paul@blockspring.com 312.834.7265
- whackedspinach 12y agoPaul, How are you securing the Docker containers since Docker hasn't yet added user namespaces?
- hackerews 12y agoContainers open and close with every script run and then they're deleted. Never reopened.
- whackedspinach 12y agoDo you run the scripts as a specific user inside the container then? I was under the impression that running untrusted code in Docker as UID 0 was not yet safe.
- mentat 12y agoIt would be sort of cool to implement cryptanalysis tools as APIs using this. Like "submit your data and we'll tell you what it might be". I built some tools in python the first time I was working on the Matasano crypto challenges but Go is a better choice. Would be nice if it was supported.
- hackerews 12y agoWill get you GO asap.
- donniezazen 12y agoWhat are you options if a site/service doesn't provide an API? I am looking into creating a third-party Android app for https://askbot.com/ https://askbot.com/ which is an open-sourced (GPLv3) version of StackExchange-like website. Askbot has a limited read-only API. It is written in Python and I am not sure how much work it would be to write APIs for it.
- dheera 12y agoI'd be more interested in seeing an infrastructure for scraping where the API functions are fixed, but the actual scraping functions are dynamically loaded so that the API user doesn't have to maintain it or re-pull/re-fork/re-compile when the website design changes. Bonus points if one can make an ORM out of it, e.g. for article in get_api('reddit.com').todayilearned.filter('new').limit(100): ... do something ... Where a call to get_api() dynamically fetches the latest scraping functions, in case reddit's page design has changed. Triple bonus points if the system can be designed in a de-centralized fashion to defend against ToSes that try to disrciminate between human eyes and machine eyes.
- donpinkus 12y agoHey dheera that's super interesting. Since it's about web scraping specifically, I bet the guys over at Kimonolabs.com would be the experts on that! Or if someone on here knows how to do this, and wants to throw up an API on Blockspring for it, we'd all love it :)
- notastartup 12y agoI created http://scrape.ly http://scrape.ly with some of those points described. It's a bit of journey of getting there and I'd love to know in more detail about what you have in mind. The API generation with Blockspring and Kimonolab is very nicely done but I like to focus solely on the web scraping more, as it represents very difficult set of challenges.
- jacke 12y agoCheck this out: https://github.com/hmarr/codecube https://github.com/hmarr/codecube 1. It's open source 2. Put this on heroku and use it privately. 3. Highly stable(because it's write using golang, you can run millions of request, and it's still work fine) ??? NONPROFIT But project no longer in developing, so i guess maybe someone wants to reanimate codecube? On weekends for example, contact me: iamjacke AT gmail.com
- gear54rus 12y ago+1 for Good Will Hunting reference
- jawbone 12y agoThanks a lot for the link. Right at the time we are looking for resources to build and figure out the structure for the APi :D
- epaga 12y agoYou guys need to chat with IFTTT - if IFTTT could ping an API I made and trigger stuff with it, that would be incredibly powerful & awesome.
- deadgrey19 12y agoI really don't understand what's happening here. I think we use the term "API" and "server" differently. When I think of an API, I think of a library or something that I can link to. For example the POSIX API, or the P-Threads API. These are available in one way or anther from any language. This seems to think very differently about APIs. As if APIs are somehow tied to a specific language? When they use the term API, do they maybe mean library? I think that under the hood, the idea is that, if you want to do something, in another language (rather than just writing it in the language) you somehow generate a stub in both languages and then proxy through a (network?) connection? To make this more complex, it seems that the proxy connections are not just on the local machine, but over the internet to another machine. Presumably you have to pay for this? Am I right? This seems like a lot of effort to go through just to avoid figuring out how to do something directly. With really sucky performance implications. I guess it depends on what you're doing. Most languages support a foreign interface to C, so maybe that is a more sensible way to do this rather than setting up "servers" and tunnelling commands and data back and forth. EDIT: I just had another look at the website. So, when they use the term API - it would seem that they mean some sort of an HTTP based web interface? The idea is that you have some kind of script that does something for you and you can query it from you local script. I still don't understand why you'd want to do this over running it locally?
- hackerews 12y agoHey Deadgrey, You're totally right. I'm not sure API is the best word for it, but haven't found a better one. Would love your thoughts! I've heard a bunch of crazy usecases from HN over the past day but my original one was to simply take some of the python and R scripts I had, and without much work (a few clicks actually) be able to execute them from my frontnd js, or from rails workers. It worked really well so we decided to see if others might find it useful too. It's badass to see what others are coming up with in the API Library, hoping that can be a valuable page for everyone. And I imagine when we figure out fair pricing, we can actually make this significantly cheaper than a dedicated server for these processes. Please, continue to send feedback like this. You're awesome. -Paul@blockspring.com 3128347265
- bwood 12y agoI think the idea is that if you have a useful script, you can set it up here just once and it's automatically wrapped with an HTTP-based interface so you can use it like an API. Now you can use that script from any Internet-connected device, with basically zero setup on each device. I'm not sure if I can think of something I'd want to use it for, but this is an interesting idea and a great proof-of-concept implementation. I think perhaps the most interesting part of this is that they're apparently spinning up/down Python (and other languages) sandbox environments on the fly, nearly instantaneously.
- giancarlostoro 12y agoI'm surprised they don't monetize this, I think it's really neat, especially selling the solution for private use.
- donpinkus 12y agoTruth is most people's APIs really cost us nothing to run, so we'd rather not charge for it :P I'm a really big believer in sites that provide a ton of utility for free, and only charge you when you're actually costing the company something. That said if you do want to use a ton of CPU, that gets expensive for us - so we may make paid accounts for people that use CPU heavy API's. We realized Blockspring would still be a lot cheaper than keeping your own EC2 server up all the time, so that's sorta cool! Also if you wanted it set-up locally at your company and 24/7 phone support (from the two of us), we'd have a paid account to cover our time. Obviously if you have ideas let us know!