BrightonSEO 2020 - Mastering The API and Having Fun Along The Way

defaced
Mastering the API
and having fun along the way.
defaced
{
"chris_johnson": {
"work": "bamboo_nine",
"twitter": "@defaced",
"linkedin": "dfcd.co/linkedin",
"slides": "dfcd.co/bseo-slides"
}
}
defaced
APIs?!
defaced
defaced
defaced
Mastering the API
1. Utilising existing APIs
2.
3.
4.
defaced
Mastering the API
1.
2. Building your own
3.
4.
defaced
Mastering the API
1.
2.
3. Supercharging your APIs
4.
defaced
Mastering the API
1.
2.
3.
4. Having fun
defaced
Not all APIs are created equal.
defaced
Introducing…
Ask An SEO.dev
defaced
defaced
Q. Is * a ranking factor?
defaced
A. …
defaced
A. It depends.
defaced
How can I access this resource?
api.askanseo.dev
defaced
POSTGET
HTTP Methods
defaced
import requests
question = 'Is * a ranking factor?'
response = requests.get('https://api.askanseo.dev/?question=' + question)
# Returns true if a valid 200 response was sent.
if response:
# Print the JSON output.
print(response.json())
else:
# We didn't receive a valid 200 response. Handle the error.
print(response.status_code)
GET
defaced
import requests
request = {'question': 'Is * a ranking factor?’}
response = requests.post('https://api.askanseo.dev/', json=request)
# Returns true if a valid 200 response was sent.
if response:
# Print the JSON output.
print(response.json())
else:
# We didn't receive a valid 200 response. Handle our error.
print(response.status_code)
POST
defaced
{
"question": "is * a ranking factor?",
"answer": "it depends"
}
RESPONSE
defaced
Enhance your workflow with APIs.
defaced
Metric: Transactions
Dimension: Transaction ID
defaced
defaced
Using Google Analytics Python API
dfcd.co/dupe-check
defaced
{
'reportRequests’: [
{
'viewId': analytics_view_id,
'dateRanges': [
{'startDate': start_date,'endDate': end_date}
],
'metrics': [{'expression': 'ga:transactions'}],
'dimensions': [{'name': 'ga:transactionId'}],
'pageSize': 1,
'orderBys': [
{'fieldName': 'ga:transactions','sortOrder': 'DESCENDING'}
]
}
]
}
defaced
{
"result": true
}
RESPONSE
defaced
Building your own APIs.
defaced
:~$ Move away from the CMD line.
defaced
Serving your own API
1. On your desk
2.
3.
defaced
Serving your own API
1.
2. Under your desk
3.
defaced
Serving your own API
1.
2.
3. Under someone else’s desk*
* Not an actual desk
defaced
Google Cloud Functions.
cloud.google.com/functions
defaced
defaced
defaced
Your first cloud function.
Ask An SEO API
defaced
from flask import jsonify
def api(request):
# Retrieve our GET data
request_args = request.args
# Check to see if valid data was sent via GET
if request_args and 'question' in request_args:
q = request_args['question']
return jsonify(question=q, answer='it depends')
# Otherwise reply with a 400 error
else:
return jsonify(error='bad request'), 400
GET
defaced
from flask import jsonify
def api(request):
# Retrieve our POST data
request_json = request.get_json()
# Check to see if valid data was sent via POST
if request_json and 'question' in request_json:
q = request_json['question']
return jsonify(question=q, answer='it depends')
# Otherwise reply with a 400 error
else:
return jsonify(error='bad request'), 400
POST
defaced
question = 'Is * a ranking factor?'
requests.get('https://cloud-function-url/api?question=' + question)
GET
defaced
request = {'question': 'Is * a ranking factor?’}
requests.post('https://cloud-function-url/api', json=request)
POST
defaced
Request blocked.
CORS the anti-fun policy
defaced
Your second cloud function.
JavaScript Difference’r
defaced
defaced
Puppeteering from the clouds.
dfcd.co/js-differ
defaced
// Navigate to URL
await page.goto(url)
// Take an image with JavaScript
const imageJavascript = await page.screenshot()
// Disable JavaScript
await page.setJavaScriptEnabled(false)
// Navigate to URL
await page.goto(url)
// Take an image without JavaScript
const imageNoJavascript = await page.screenshot()
defaced
defaced
This sounds expensive!
defaced
Layout Shift GIF Generator.
dfcd.co/layout-shift
defaced
Over 4,500 GIFs generated.
£1.60
defaced
Supercharging your APIs.
defaced
Automate your workflow.
defaced
Save every API response.
defaced
Compare with your last saved
response.
dfcd.co/dict-differ
defaced
If there’s a difference, do
something.
dfcd.co/slack-api
defaced
Visualise your API toolkit.
Dashboards and widgets
defaced
defaced
Get creative.
@theshapeofashow
defaced
defaced
Halt and Catch Fire
Season 1 - 4
defaced
Bounce Rate
2017 - 2019
defaced
Introducing…
Printerbot
defaced
defaced
API driven.
Web connected.
Thermal printer.
defaced
defaced
defaced
Oops.
defaced
Gameboy Camera & Printerbot.
defaced
defaced
Live demo.
@defaced
defaced
defaced
defaced
Thank you.
dfcd.co/bseo-slides
1 of 71

Recommended

Plone api by
Plone apiPlone api
Plone apiNejc Zupan
1.8K views52 slides
"Managing API Complexity". Matthew Flaming, Temboo by
"Managing API Complexity". Matthew Flaming, Temboo"Managing API Complexity". Matthew Flaming, Temboo
"Managing API Complexity". Matthew Flaming, TembooYandex
3K views38 slides
API 101 - Understanding APIs. by
API 101 - Understanding APIs.API 101 - Understanding APIs.
API 101 - Understanding APIs.Kirsten Hunter
22.5K views58 slides
Git store by
Git storeGit store
Git storeKirsten Hunter
357 views20 slides
Cain & Obenland — Episode 4 by
Cain & Obenland — Episode 4Cain & Obenland — Episode 4
Cain & Obenland — Episode 4Konstantin Obenland
1.9K views33 slides
API Prefetching - HTML5DevConf - Oct. 21, 2014 by
API Prefetching - HTML5DevConf - Oct. 21, 2014API Prefetching - HTML5DevConf - Oct. 21, 2014
API Prefetching - HTML5DevConf - Oct. 21, 2014JonAbrams
1.4K views32 slides

More Related Content

What's hot

It could happen to anyone - FrontEnd Connect 2017 by
It could happen to anyone - FrontEnd Connect 2017It could happen to anyone - FrontEnd Connect 2017
It could happen to anyone - FrontEnd Connect 2017Asim Hussain
815 views58 slides
Rich UI with Knockout.js & Coffeescript by
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptAmir Barylko
2.4K views45 slides
Alloy backbone by
Alloy backboneAlloy backbone
Alloy backboneBraden Powers
7K views22 slides
Story ofcorespring infodeck by
Story ofcorespring infodeckStory ofcorespring infodeck
Story ofcorespring infodeckMakarand Bhatambarekar
558 views25 slides
Get cfml Into the Box 2018 by
Get cfml Into the Box 2018Get cfml Into the Box 2018
Get cfml Into the Box 2018Ortus Solutions, Corp
413 views65 slides
Powershell to the People #suguk by
Powershell to the People #sugukPowershell to the People #suguk
Powershell to the People #sugukChris McKinley
488 views16 slides

What's hot(20)

It could happen to anyone - FrontEnd Connect 2017 by Asim Hussain
It could happen to anyone - FrontEnd Connect 2017It could happen to anyone - FrontEnd Connect 2017
It could happen to anyone - FrontEnd Connect 2017
Asim Hussain815 views
Rich UI with Knockout.js & Coffeescript by Amir Barylko
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & Coffeescript
Amir Barylko2.4K views
Powershell to the People #suguk by Chris McKinley
Powershell to the People #sugukPowershell to the People #suguk
Powershell to the People #suguk
Chris McKinley488 views
Puppet Roles & Profiles Using Trusted Facts. by Stephen Wallace
Puppet Roles & Profiles Using Trusted Facts.Puppet Roles & Profiles Using Trusted Facts.
Puppet Roles & Profiles Using Trusted Facts.
Stephen Wallace2.1K views
Quick Way to work with Models and Alloy in Appcelerator Titanium by Aaron Saunders
Quick Way to work with Models and Alloy in Appcelerator TitaniumQuick Way to work with Models and Alloy in Appcelerator Titanium
Quick Way to work with Models and Alloy in Appcelerator Titanium
Aaron Saunders8.4K views
APIs explained for product managers by Richard Holmes
APIs explained for product managersAPIs explained for product managers
APIs explained for product managers
Richard Holmes119 views
Advanced API Design: how an awesome API can help you make friends, get rich, ... by Jonathan Dahl
Advanced API Design: how an awesome API can help you make friends, get rich, ...Advanced API Design: how an awesome API can help you make friends, get rich, ...
Advanced API Design: how an awesome API can help you make friends, get rich, ...
Jonathan Dahl1.6K views
Enemy of the state by Mike North
Enemy of the stateEnemy of the state
Enemy of the state
Mike North2.8K views
The Power of Open Data by Phil Windley
The Power of Open DataThe Power of Open Data
The Power of Open Data
Phil Windley553 views
Outside-in Development with Cucumber and Rspec by Joseph Wilk
Outside-in Development with Cucumber and RspecOutside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and Rspec
Joseph Wilk8.1K views
The React Cookbook: Advanced Recipes to Level Up Your Next App by FITC
The React Cookbook: Advanced Recipes to Level Up Your Next AppThe React Cookbook: Advanced Recipes to Level Up Your Next App
The React Cookbook: Advanced Recipes to Level Up Your Next App
FITC985 views
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd... by WordCamp Sydney
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
WordCamp Sydney1.2K views
Enter the app era with ruby on rails (rubyday) by Matteo Collina
Enter the app era with ruby on rails (rubyday)Enter the app era with ruby on rails (rubyday)
Enter the app era with ruby on rails (rubyday)
Matteo Collina5K views
Integrating External APIs with WordPress by Marty Thornley
Integrating External APIs with WordPressIntegrating External APIs with WordPress
Integrating External APIs with WordPress
Marty Thornley20.6K views
Testing with Ruby by Joseph Wilk
Testing with RubyTesting with Ruby
Testing with Ruby
Joseph Wilk808 views

Similar to BrightonSEO 2020 - Mastering The API and Having Fun Along The Way

Api testing by
Api testingApi testing
Api testingKeshav Kashyap
30.2K views21 slides
ApacheCon 2005 by
ApacheCon 2005ApacheCon 2005
ApacheCon 2005Adam Trachtenberg
649 views43 slides
Building WordPress Client Side Applications with WP and WP-API - #wcmia by
Building WordPress Client Side Applications with WP and WP-API - #wcmiaBuilding WordPress Client Side Applications with WP and WP-API - #wcmia
Building WordPress Client Side Applications with WP and WP-API - #wcmiaRoy Sivan
729 views25 slides
Crafting [Better] API Clients by
Crafting [Better] API ClientsCrafting [Better] API Clients
Crafting [Better] API ClientsWellfire Interactive
282 views96 slides
August 10th, 2009 Dave Ross Word Press by
August 10th, 2009 Dave Ross Word PressAugust 10th, 2009 Dave Ross Word Press
August 10th, 2009 Dave Ross Word PressStraight North
442 views18 slides
Caldera Learn - LoopConf WP API + Angular FTW Workshop by
Caldera Learn - LoopConf WP API + Angular FTW WorkshopCaldera Learn - LoopConf WP API + Angular FTW Workshop
Caldera Learn - LoopConf WP API + Angular FTW WorkshopCalderaLearn
12.4K views122 slides

Similar to BrightonSEO 2020 - Mastering The API and Having Fun Along The Way(20)

Building WordPress Client Side Applications with WP and WP-API - #wcmia by Roy Sivan
Building WordPress Client Side Applications with WP and WP-API - #wcmiaBuilding WordPress Client Side Applications with WP and WP-API - #wcmia
Building WordPress Client Side Applications with WP and WP-API - #wcmia
Roy Sivan729 views
August 10th, 2009 Dave Ross Word Press by Straight North
August 10th, 2009 Dave Ross Word PressAugust 10th, 2009 Dave Ross Word Press
August 10th, 2009 Dave Ross Word Press
Straight North442 views
Caldera Learn - LoopConf WP API + Angular FTW Workshop by CalderaLearn
Caldera Learn - LoopConf WP API + Angular FTW WorkshopCaldera Learn - LoopConf WP API + Angular FTW Workshop
Caldera Learn - LoopConf WP API + Angular FTW Workshop
CalderaLearn12.4K views
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜 by 崇之 清水
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
崇之 清水2.8K views
Building Better Web APIs with Rails by All Things Open
Building Better Web APIs with RailsBuilding Better Web APIs with Rails
Building Better Web APIs with Rails
All Things Open1.4K views
How to build Client Side Applications with WordPress and WP-API | #wcmia by Roy Sivan
How to build Client Side Applications with WordPress and WP-API | #wcmiaHow to build Client Side Applications with WordPress and WP-API | #wcmia
How to build Client Side Applications with WordPress and WP-API | #wcmia
Roy Sivan1.9K views
Enter the app era with ruby on rails by Matteo Collina
Enter the app era with ruby on railsEnter the app era with ruby on rails
Enter the app era with ruby on rails
Matteo Collina4.5K views
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotion by javier ramirez
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotionAPIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
javier ramirez1.9K views
QA Fest 2017. Игорь Любин. Примеры ускорения автотестов by QAFest
QA Fest 2017. Игорь Любин. Примеры ускорения автотестовQA Fest 2017. Игорь Любин. Примеры ускорения автотестов
QA Fest 2017. Игорь Любин. Примеры ускорения автотестов
QAFest508 views
WordPress RESTful API & Amazon API Gateway (English version) by 崇之 清水
WordPress RESTful API & Amazon API Gateway (English version)WordPress RESTful API & Amazon API Gateway (English version)
WordPress RESTful API & Amazon API Gateway (English version)
崇之 清水886 views
Building robust REST APIs by Nejc Zupan
Building robust REST APIsBuilding robust REST APIs
Building robust REST APIs
Nejc Zupan376 views
Webinar - Office 365 & PowerShell : A Match Made in Heaven by Sébastien Levert
Webinar - Office 365 & PowerShell : A Match Made in HeavenWebinar - Office 365 & PowerShell : A Match Made in Heaven
Webinar - Office 365 & PowerShell : A Match Made in Heaven
Sébastien Levert488 views
Simple Web Apps With Sinatra by a_l
Simple Web Apps With SinatraSimple Web Apps With Sinatra
Simple Web Apps With Sinatra
a_l2.5K views

Recently uploaded

MOSORE_BRESCIA by
MOSORE_BRESCIAMOSORE_BRESCIA
MOSORE_BRESCIAFederico Karagulian
5 views8 slides
VoxelNet by
VoxelNetVoxelNet
VoxelNettaeseon ryu
7 views21 slides
[DSC Europe 23] Ivana Sesic - Use of AI in Public Health.pptx by
[DSC Europe 23] Ivana Sesic - Use of AI in Public Health.pptx[DSC Europe 23] Ivana Sesic - Use of AI in Public Health.pptx
[DSC Europe 23] Ivana Sesic - Use of AI in Public Health.pptxDataScienceConferenc1
5 views15 slides
Data about the sector workshop by
Data about the sector workshopData about the sector workshop
Data about the sector workshopinfo828217
12 views27 slides
Ukraine Infographic_22NOV2023_v2.pdf by
Ukraine Infographic_22NOV2023_v2.pdfUkraine Infographic_22NOV2023_v2.pdf
Ukraine Infographic_22NOV2023_v2.pdfAnastosiyaGurin
1.4K views3 slides
[DSC Europe 23] Aleksandar Tomcic - Adversarial Attacks by
[DSC Europe 23] Aleksandar Tomcic - Adversarial Attacks[DSC Europe 23] Aleksandar Tomcic - Adversarial Attacks
[DSC Europe 23] Aleksandar Tomcic - Adversarial AttacksDataScienceConferenc1
5 views20 slides

Recently uploaded(20)

Data about the sector workshop by info828217
Data about the sector workshopData about the sector workshop
Data about the sector workshop
info82821712 views
Ukraine Infographic_22NOV2023_v2.pdf by AnastosiyaGurin
Ukraine Infographic_22NOV2023_v2.pdfUkraine Infographic_22NOV2023_v2.pdf
Ukraine Infographic_22NOV2023_v2.pdf
AnastosiyaGurin1.4K views
Advanced_Recommendation_Systems_Presentation.pptx by neeharikasingh29
Advanced_Recommendation_Systems_Presentation.pptxAdvanced_Recommendation_Systems_Presentation.pptx
Advanced_Recommendation_Systems_Presentation.pptx
Chapter 3b- Process Communication (1) (1)(1) (1).pptx by ayeshabaig2004
Chapter 3b- Process Communication (1) (1)(1) (1).pptxChapter 3b- Process Communication (1) (1)(1) (1).pptx
Chapter 3b- Process Communication (1) (1)(1) (1).pptx
ayeshabaig20046 views
[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx by DataScienceConferenc1
[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx
[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx
[DSC Europe 23] Zsolt Feleki - Machine Translation should we trust it.pptx by DataScienceConferenc1
[DSC Europe 23] Zsolt Feleki - Machine Translation should we trust it.pptx[DSC Europe 23] Zsolt Feleki - Machine Translation should we trust it.pptx
[DSC Europe 23] Zsolt Feleki - Machine Translation should we trust it.pptx
Short Story Assignment by Kelly Nguyen by kellynguyen01
Short Story Assignment by Kelly NguyenShort Story Assignment by Kelly Nguyen
Short Story Assignment by Kelly Nguyen
kellynguyen0119 views
[DSC Europe 23] Spela Poklukar & Tea Brasanac - Retrieval Augmented Generation by DataScienceConferenc1
[DSC Europe 23] Spela Poklukar & Tea Brasanac - Retrieval Augmented Generation[DSC Europe 23] Spela Poklukar & Tea Brasanac - Retrieval Augmented Generation
[DSC Europe 23] Spela Poklukar & Tea Brasanac - Retrieval Augmented Generation
Cross-network in Google Analytics 4.pdf by GA4 Tutorials
Cross-network in Google Analytics 4.pdfCross-network in Google Analytics 4.pdf
Cross-network in Google Analytics 4.pdf
GA4 Tutorials6 views
Data Journeys Hard Talk workshop final.pptx by info828217
Data Journeys Hard Talk workshop final.pptxData Journeys Hard Talk workshop final.pptx
Data Journeys Hard Talk workshop final.pptx
info82821710 views
SUPER STORE SQL PROJECT.pptx by khan888620
SUPER STORE SQL PROJECT.pptxSUPER STORE SQL PROJECT.pptx
SUPER STORE SQL PROJECT.pptx
khan88862012 views
CRM stick or twist.pptx by info828217
CRM stick or twist.pptxCRM stick or twist.pptx
CRM stick or twist.pptx
info82821710 views

BrightonSEO 2020 - Mastering The API and Having Fun Along The Way