https://community.algolia.com/marvel-search/

Super-powers with
APIs

Tim Carry

@pixelastic
Algolia
HumanTalks
TechLunch
1
Getting
data
from an
API
2
Using
data
with an
API
Application
Programming
Interface

Getting
the data

Getting
the data

Wikipedia
Marvel

Wikipedia
API

http://dbpedia.org/data/
Hulk_(comics)
.json
{
 "abstract": [
  {
    "lang": "en",
    "value": "Hulk is a fictional character, a superhero […]"
  }
 ],
 "aliases": [
  {
    "lang": "en",
    "value": "Robert Bruce Banner, Joe Fixit, War, World-Breaker, Doc Green"
  }
 ]
}

Marvel
API

http://gateway.marvel.com/v1/public/characters/
1009351
{
 "name": "Hulk",
 "thumbnail": "www.marvel.com/538615ca33ab0.jpg",
 "description": 
   "Caught in a gamma bomb explosion while trying to save the life of a teenager, [...]",
}

Incomplete
API

Scraping
Extract content from HTML using CSS selectors
nokogiri
scrapy
x-ray
<div class="description">
 <h4>Hulk</h4>
 <img 
   src="./hulk.png" 
   class="thumbnail"
 />
</div>
$('.description h4').text()
$('.description img').attr('src')
{
 "name": "Hulk",
 "thumbnail": "./hulk.png"
}

Transforming
the data

S
oftware
a
s
a
S
ervice

Search instantly in
your data
  • Fast
  • Relevant
  • Typo-tolerant
  • Plurals
  • Synonyms
  • Highlight
  • Filters
  • [...]

Cloudinary

Apply effects on
your images
  • Compress
  • Resize
  • Black & White
  • Blur
  • Crop
  • Face recognition
  • [...]
1920x840px, 92KB
450x197px, 26KB

Serverless

Hosting
Free
if public
Search
Free
up to 10k records
Images
Free
up to 7k images

Conclusion

APIs can be used to
get
data
but also to
transform
data
Use them and build stuff.

Questions?

@pixelastic