If a platform provider has an 'API', how do you know what programming language to do your queries to that provider?

Yashy
Yashy used Ask the Experts™
on
Hi guys

I'm not a developer so bear with me with the simplistic question. I'm trying to understand how API's work. For example, let's say an ecommerce platform says that you can connect to their API in order to do your queries from your site. My question is, how do you know what programming language to write it in so that you can have your query made?

Does the platform provider have to tell you the language compatibility?

Thanks for helping
Yash
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dr. KlahnPrincipal Software Engineer

Commented:
Does the platform provider have to tell you the language compatibility?

Yes, and frequently there is no choice.  If you want a different language, you must write a shim between the provider's API and your desired target.  This is not uncommon; perl, for example, has thousands of such shims.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Sometimes the API is defined as REST or something like that which is actually based on HTTP transfers.
In that case you need something that can talk HTTP (which does not specify upfront which programming language to use).

So yes it should be specified but it might be indifferent to programming languages if some networking is involved.

Author

Commented:
So basically, most people use 'shims' in order for the queries to become translated from source to destination?

If let's say I have my own business for providing flight prices to people such as 'SkyScanner', I have to use API calls to connect to the providers such as the airlines right? Each of those airlines will probably use different languages for me to be able to do API calls to them? How would it work?
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

nociSoftware Engineer
Distinguished Expert 2018
Commented:
Depends...    If one provider created a REST web interface then you use some library to interface with that Your language Choice...

If another Airline provides you with a PERL module that you need to build somthig in perl..,
and yet another provides you with some C++ library and another provides some COBOL (or your choice of FORTRAN) then you need to use those languages to build a more generic internal interface which can cover for all and provide a way to select the right backend.

[API1]---[CLIENT1]--[INTERNALAPI]
[API2]---[CLIENT2]--[INTERNALAPI]
[API3]---[CLIENT3]--[INTERNALAPI]
[API4]---[CLIENT4]--[INTERNALAPI]

And if you use a network interface between [INTERNALAPI]---[INTERNALCLIENT] you have sufficient decoupling from languages.

If all stuff happens on the Internet you already do have Decoupling by network... Then it only depends if you can use a API like REST, RPC, ...
Fractional CTO
Distinguished Expert 2018
Commented:
1) You can use any language you like. HTTPS is just text, so any language can be used.

2) Most companies will provide some sort of SDK (software development kit) for various languages, like PHP + Ruby.

3) If you use a language matching one of the provide SDKs, your development time will be much shorter than developing your own SDK.

4) Most SDKs take the form of a library to call, along with sample code showing how to use the library.

5) To develop your own SDK for an unsupported language may require a large time/budget commitment, then you'll have to deal with the problem of maintenance.

Tip: If you stick to using a PHP SDK (almost every API provides one), then your development + future maintenance will be faster/cheaper, than developing your own SDK.
The API that you talk about are for a web site to connect to an ecommerce platform.
This means that with a 99.99% probability the API is delivered and consumed over the internet via HTTP.
In other words, it will most likely be a variant of a REST API, maybe based on plain HTTP calls, or at the worst case it will be a SOAP interface.

Any language is good to use for HTTP API calls.
Hell, I've written complex API interfaces using windows command files :((

Having said that, the ecommerce vendor  may have an sdk tied to a specific language, or examples in a specific language. Your best bet is to use that.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial