Slide 1

Slide 1 text

Why is an API like a puppy? Ade Oshineye

Slide 2

Slide 2 text

Who am I and why am I here?

Slide 3

Slide 3 text

Share what you learn This is Dave and I at PLOP 2005. We’re grateful to the people who shared what they’ve learned. That’s why I’m going to share some things I’ve learned today.

Slide 4

Slide 4 text

Who here has young children? Imagine I were to visit you and give your children a free puppy. What would happen?

Slide 5

Slide 5 text

Who wants a free puppy?

Slide 6

Slide 6 text

Free as in speech/beer/puppy Free as in beer/speech/puppy The worst kind of free. Overlooks the costs, responsibilities and consequences

Slide 7

Slide 7 text

Real puppies Public APIs are different Let’s talk about some common but incorrect beliefs that people hold about public APIs

Slide 8

Slide 8 text

Public API with real users doing business-valuable things in a competitive environment It also means that when I say API (in this presentation) I mean...

Slide 9

Slide 9 text

Public API with real users doing business-valuable things in a competitive environment It also means that when I say API (in this presentation) I mean...

Slide 10

Slide 10 text

Public API with real users doing business-valuable things in a competitive environment It also means that when I say API (in this presentation) I mean...

Slide 11

Slide 11 text

Public API with real users doing business-valuable things in a competitive environment It also means that when I say API (in this presentation) I mean...

Slide 12

Slide 12 text

Public API with real users doing business-valuable things in a competitive environment It also means that when I say API (in this presentation) I mean...

Slide 13

Slide 13 text

Do you work on a public API?

Slide 14

Slide 14 text

Experience comes from mistakes At Google we’ve been around long enough to have believed and regretted all of the following misconceptions

Slide 15

Slide 15 text

Common assumptions

Slide 16

Slide 16 text

API-first development

Slide 17

Slide 17 text

API-first development Everybody can use the same API

Slide 18

Slide 18 text

1 2 3 4 Private API Consumer-facing UI Public API Ship it! Building a new feature First you build a private API then you build the consumer-facing product on top of it then you expose a public API that others can use and then you find out if it’s a good idea.

Slide 19

Slide 19 text

• Inappropriate API design • Inappropriate authentication model Costs and consequences

Slide 20

Slide 20 text

• Slower pace of development • Less flexibility Costs and consequences

Slide 21

Slide 21 text

APIs are free

Slide 22

Slide 22 text

APIs are free Development is the main cost

Slide 23

Slide 23 text

• Who writes your public documentation? • Who answers questions on Stack Overflow? • Who promotes your API? Costs and consequences

Slide 24

Slide 24 text

• Who prioritises and fixes API-specific bugs? • Who identifies and resolves API abuse/spam? Costs and consequences

Slide 25

Slide 25 text

API design is a solved problem “Just use ReST” Generic clients and HATEOAS will take care of the rest

Slide 26

Slide 26 text

API design is a solved problem Just use ReST “Just use ReST” Generic clients and HATEOAS will take care of the rest

Slide 27

Slide 27 text

• You find yourself saying HATEOAS to angry people and it doesn’t make them less angry about the lack of documentation • You discover that the ways people want to use your APIs don’t map cleanly to the collections of resources that you designed Costs and consequences

Slide 28

Slide 28 text

• You discover that you need client libraries for a variety of languages • You discover painful trade-offs involving API keys and OAuth Costs and consequences

Slide 29

Slide 29 text

“If you build it they will come”

Slide 30

Slide 30 text

“If you build it they will come” API quality determines success

Slide 31

Slide 31 text

???? This is a hackathon for Buzz in Stockholm in 2010. We did everything right from an API perspective but it wasn’t enough. We broke McKellar’s Law.

Slide 32

Slide 32 text

“A developer platform is only useful and interesting if it enhances something that’s already useful and is already used.” McKellar’s Law

Slide 33

Slide 33 text

Most successful public API at Google? What’s Google’s most commercially successful API? What technology does it use?

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Popularity means success

Slide 36

Slide 36 text

These APIs have something in common Twitter Snapchat Google Translate They became popular and then realised that wasn’t why they built an API

Slide 37

Slide 37 text

Twitter’s quadrants Twitter realised that they could only make money with advertising if they controlled the most popular clients

Slide 38

Slide 38 text

Snapchat’s ephemerality Snapchat realised that there were guarantees that only a trusted client could enforce

Slide 39

Slide 39 text

Google Translate and abuse Translate was sunset and then revived with a pricing plan because that’s the only way to control the kinds of abuse that happens with machine translation

Slide 40

Slide 40 text

How do I know if I'm ready for an API?

Slide 41

Slide 41 text

Short* answer: maturity This is why parents typically tell their children “when you’re older” rather than “you’re not mature enough”

Slide 42

Slide 42 text

The API has a good reason to exist Whatever benefit you get from the API is enough to justify all of the costs

Slide 43

Slide 43 text

You have a value exchange that works You know why your API is valuable You give something You get something Both sides are happy

Slide 44

Slide 44 text

It scales with traffic 1 million QPD makes you happy 1 billion QPD also makes you happy 1 trillion QPD makes you even happier

Slide 45

Slide 45 text

It survives the passage of time It will still make sense in the future

Slide 46

Slide 46 text

You understand that public APIs have a lifecycle

Slide 47

Slide 47 text

Launch=>Versions=>Deprecation Ship V1. Ship new versions that break backwards compatibility. Shut down old versions.

Slide 48

Slide 48 text

You know how much your API will cost In terms of: - development -maintenance -support -staffing -opportunity cost for your core product

Slide 49

Slide 49 text

All aspects of the developer experience API Explorers to bug trackers

Slide 50

Slide 50 text

Do you have the right team? You understand all the aspects that need to exist for your team to succeed

Slide 51

Slide 51 text

Customers? You know who the potential customers and competitors are. You know how you will drive adoption of your API amongst those customers and in the face of competitive pressure

Slide 52

Slide 52 text

Competitors? You know who the potential customers and competitors are. You know how you will drive adoption of your API amongst those customers and in the face of competitive pressure

Slide 53

Slide 53 text

I’ve covered a lot of the pitfalls involved in launching a public API and hopefully it’s made you think twice. You now realise that the free puppy has hidden costs but my goal wasn’t to scare you away.

Slide 54

Slide 54 text

Personally I love APIs but I also know that...

Slide 55

Slide 55 text

APIs, like puppies, are an expensive long-term commitment... But sometimes they’re worth it.

Slide 56

Slide 56 text

No content