DEV Community

JavaScript Joel
JavaScript Joel

Posted on

What free open API's do you use to demo code?

You are demoing some code. That code needs to hit an API... any API.

It's gotta be basic. Probably just an HTTP GET.

I found REQ | RES, which looks interesting. There's also The Cat API, which looks fun.

What do you reach for?

Top comments (12)

Collapse
 
ben profile image
Ben Halpern
Collapse
 
joelnet profile image
JavaScript Joel

I decided to go with SWAPI. Here's the examoke I was creating: mojiscript.js.org/#/function-lift-p

This function is for something new I am working on called Promise Lifting.

Cheers!

Collapse
 
jessegilbride profile image
Jesse Gilbride

The National Park Service API is easy to use, but does have a few bugs. (Hasn't been updated in a long time, maybe due to the last administration's defunding, etc.)

Spoonacular has a lot of endpoints, but the docs aren't great.

Also, there's this repo of public APIs: github.com/public-apis/public-apis

Collapse
 
joelnet profile image
JavaScript Joel

National Park Service has an API. That's interesting. 🤔

Collapse
 
jessegilbride profile image
Jesse Gilbride
Collapse
 
kip13 profile image
kip • Edited
Collapse
 
baddev profile image
BadDev
Collapse
 
joelnet profile image
JavaScript Joel

Great question!

My use-case is I am writing documentation for a library (MojiScript) and want to provide example code that is runnable and also a real-world usage type example.

My second use-case is I write a lot of articles that demonstrate JavaScript code. I also want these examples to be runnable. I also want them to be more relatable to the readers real life use cases and not some contrived examples.

Something like a web server is too heavy for these types of demonstrations.

I'm sure there are many other valid use cases for them, otherwise they would not exist.

Soon we’ll be looking for the 3rd party services that write the code we need for us.

I think they call this NPM.

Collapse
 
annegentle profile image
Anne Gentle

deckofcardsapi.com - data model makes sense, no auth so easy on ramp, JSON readability that’s within reach and visual if you want.

Collapse
 
joelnet profile image
JavaScript Joel

That is an interesting API. I haven't seen that one. I'll have to keep this one in mind.

Collapse
 
davidchase profile image
David Chase
Collapse
 
joelnet profile image
JavaScript Joel

Awesome a whole list of public APIs. I'm sure I'll find something perfect for my use case in here.

Cheers!