2019-06-01 net

(Brent) #1
Keep an eye
on costs!
While APIs look fun,
developers using them can be
in for a rude awakening. First
of all, most large vendors are
well aware of how much the
service they provide would
cost on the open market.
Their trick involves letting you
sample the product for free,
while imposing significant
charges once your application
reaches a certain size.
Problem number two,
equally significant, involves
the discontinuation of APIs.
Nothing human-made is
impervious to the sands
of time – companies can
go bankrupt or simply lose
their taste for a particular
product. This problem is
best addressed by using
encapsulation: add a
custom layer between your
application and the API
and make sure that your
application code only calls the
shim not the API itself.
Finally, always keep the
cost of your API in mind. As
companies scale, the build
versus buy scale changes


  • designing a custom map
    rendering system for 10,000
    page views a day is likely to
    be uneconomic, while some
    websites can easily generate
    millions of views every day,
    thereby amortising the costs
    of a custom rendering engine.
    Finally, keep in mind
    pretension usage regulations.
    The API vendors may be
    based in countries where
    they are subject to export
    or similar legal problems;
    furthermore, public pressure
    limits the allowed use cases
    of some APIs. This might not
    be a problem for the average
    ceiling application but should
    always stay at the back of
    your mind when navigating
    the magic world of APIs.


you need to pick out facial features in a busy
image. A special mode returns cropping
advice – this is helpful if uploaded images
are to be cut down to a specific format
required by your user interface.


Google Cloud Video


Intelligence API
https://cloud.google.com/video-
intelligence/
Google is always
looking for new
ways to generate
extra revenue: an
interesting avenue
involves letting the
Vision API loose on videos. This is the raison
d’etre for the Cloud Video Intelligence API –
provide it with video data and prepare
yourself for a torrent of metadata, cropping
advice and various other bits of auto-
generated information.


Cloud Speech-to-Text /


Text-to-Speech APIs
https://cloud.google.com/speech-to-text/
https://cloud.google.com/text-to-speech/
While text might be
king in many
applications, there
are plenty of
situations where
you may want to
include voice output or input – whether
that’s catering to those with accessibility
issues or enabling people to use your sites
and apps hands free. As the development of
vocoders is cost expensive, offloading this
task sounds attractive.
Google has you covered with two sets of
APIs: one takes speech and turns it into
string text, while the other one takes the text
and generates a spoken WAV file.
From a technical point of view, the APIs
tend to work and see use in a variety of
systems like Android. However, it’s worth
keeping in mind that companies such as
Nuance offer speech detection engines that
significantly surpass the accuracy of Google’s
in some cases.


Cloud Translation API
https://cloud.google.com/translate/
overview/docs/
Multi-language
applications are
here to stay. A neat
way to distinguish
your product
involves handling
translation in-line: if your Gab viewer
automatically translates English into Russian
and German, not only will people living in
the latter two countries jump for joy but you
will expand your potential market.
Sadly, getting machine translation right
remains among the most complex problems
in IT. Google’s translation API should be
well-known to all those of you who use its
Translate app – in its simplest form, you send
a string and get a translated one in response.
While this works okay with general
purpose texts, some applications require a
little more attention. Google lets you provide
a set of keywords to tune the algorithm –
this is helpful for texts related to scientific
domains, such as electrical engineering.

Hangouts Chat API
https://developers.google.com/hangouts/
chat/concepts/bots
Google has had a
bumpy start into
social networking.
The Hangouts chat
service seems to be
the most valuable
IP Google has salvaged from its defunct
social play Google+ and seems quite likely to
become its next big thing – especially as it
can be extended to contain customer service
bots. Take a look at the Hangouts Chat API.
The bot behaves just like the IRC servers of
yore – it hangs around waiting for a user to
invoke it by mentioning its name. The
moment this happens, your code receives a
callback with the incoming information and
a bit of metadata about the user.
This data can then be used for a variety of
ways – a good example was the #srcedit bot,
which used to hang out in the channel on
freenode and provided ways to interact with
information found in SVN.

19 groundbreaking APIs

Free download pdf