Questions tagged [api]

DO NOT USE. Use specific tags like [google-cloud-platform], [facebook], [amazon-web-services] instead or [api-design] where applicable. Questions asking to recommend or find an API are off-topic.

Application Programming Interface (API) is a source code based specification intended to be used as an interface by software components to communicate with each other. A good API makes it easier to develop a program by providing all the building blocks. A programmer then puts the blocks together. An API may include specifications for routines, data structures, object classes and variables.

An API specification can take many forms, including:

  • an International Standard such as POSIX,
  • vendor documentation such as the Microsoft Windows API,
  • the libraries of a programming language - e.g. Standard Template Library in C++ or Java API.

An API differs from an ABI (Application Binary Interface) in that the former is source code based while the latter is a binary interface. For instance POSIX is an API, while the Linux Standard Base is an ABI.

Source: Wikipedia (Application Programming Interface)


Questions asking us to recommend or find an API, documentation or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam.

Link to the API Burninate Request

107148 questions
346
votes
14 answers

REST API Best practices: Where to put parameters?

A REST API can have parameters in at least two ways: As part of the URL-path (i.e. /api/resource/parametervalue ) As a query argument (i.e. /api/resource?parameter=value ) What is the best practice here? Are there any general guidelines when to…
Kalle Gustafsson
  • 3,503
  • 3
  • 15
  • 8
137
votes
9 answers

How do I get currency exchange rates via an API such as Google Finance?

Now, I did find the Google Finance API and started looking through that but I found a lot of info about portfolios, transactions, positions & other stuff I know nothing about. Am I looking at the wrong docs? What do I need to do to get a feed of…
Bogdan
  • 5,368
  • 9
  • 43
  • 62
127
votes
5 answers

Is there a Wikipedia API?

On my Wikipedia user page, I run a Wikipedia script that displays my statistics (number of pages edited, number of new pages, monthly activity, etc.). I'd like to put this information on my blog. Is there an API that would allow me to do something…
rbrayb
  • 46,440
  • 34
  • 114
  • 174
116
votes
5 answers

Why can't a Flutter application connect to the Internet when installing "app-release.apk"? But it works normally in debug mode

In debug mode, everything looks good. I get answers and data lists from my API. But after creating app-release.apk and installing it on my phone, there isn't an Internet connection any more. Here is my…
bimasakti
  • 1,369
  • 2
  • 6
  • 6
115
votes
6 answers

How to use cURL to get jSON data and decode the data?

So I have a link that returns a jSON object, and I need to have it decoded and put into variables in PHP. URL api.php?action=getThreads&hash=123fajwersa&node_id=4&order_by=post_date&order=desc&limit=1&grab_content&content_limit=1 This is the…
Maaz
  • 4,193
  • 6
  • 32
  • 50
114
votes
2 answers

API Keys vs HTTP Authentication vs OAuth in a RESTful API

I'm working on building a RESTful API for one of the applications I maintain. We're currently looking to build various things into it that require more controlled access and security. While researching how to go about securing the API, I found a few…
Shauna
  • 9,495
  • 2
  • 37
  • 54
114
votes
2 answers

What's the best way of scraping data from a website?

I need to extract contents from a website, but the application doesn’t provide any application programming interface or another mechanism to access that data programmatically. I found a useful third-party tool called Import.io that provides click…
0x1ad2
  • 8,014
  • 9
  • 35
  • 48
114
votes
28 answers

GB English, or US English?

If you have an API, and you are a UK-based developer with a highly international audience, should your API be setColour() or setColor() (To take one word as a simple example.) UK-based engineers are often quite defensive about their 'correct'…
izb
  • 50,101
  • 39
  • 117
  • 168
114
votes
15 answers

Twitter API returns error 215, Bad Authentication Data

I am trying to call following Twitter's API to get a list of followers for a user. http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=username And I am getting this error message in response. { code = 215; message = "Bad…
Dip Dhingani
  • 2,499
  • 2
  • 20
  • 18
111
votes
16 answers

PHP file_get_contents() returns "failed to open stream: HTTP request failed!"

I am having problems calling a url from PHP code. I need to call a service using a query string from my PHP code. If I type the url into a browser, it works ok, but if I use file-get-contents() to make the call, I get: Warning:…
undefined
  • 5,190
  • 11
  • 56
  • 90
109
votes
12 answers

How to Logout of an Application Where I Used OAuth2 To Login With Google?

In my application, I implemented Google signout using jsapi. I used the url https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=xxxxxx to connect to Google and then https://www.googleapis.com/plus/v1/people/xxxxxx to get user data from…
Vinesh EG
  • 1,325
  • 2
  • 9
  • 13
108
votes
5 answers

Has Facebook sharer.php changed to no longer accept detailed parameters?

We have been opening a sharing popup (via window.open) with the URL like https://www.facebook.com/sharer/sharer.php?s=100&p[title]=EXAMPLE&p[summary]=EXAMPLE&p[url]=EXAMPLE&p[images][0]=EXAMPLE and until some unknown point in the last month or so…
tdous
  • 1,599
  • 2
  • 14
  • 19
107
votes
7 answers

Scala framework for a Rest API Server?

We are thinking on moving our Rest API Server (it is inside the web service, on Symfony PHP) to Scala for several reasons: speed, no overhead, less CPU, less code, scalability, etc. I didn't know Scala until several days ago but I've been enjoying…
fesja
  • 3,313
  • 6
  • 30
  • 42
106
votes
9 answers

Catching exceptions from Guzzle

I'm trying to catch exceptions from a set of tests I'm running on an API I'm developing and I'm using Guzzle to consume the API methods. I've got the tests wrapped in a try/catch block but it is still throwing unhandled exception errors. Adding an…
Eric
  • 1,253
  • 2
  • 10
  • 15
105
votes
11 answers

How exactly to use Notification.Builder

I found that I am using a deprecated method for noficitations (notification.setLatestEventInfo()) It says to use Notification.Builder. How do I use it? When I try to create a new instance, it tells me: Notification.Builder cannot be resolved to a…
Saariko
  • 1,703
  • 4
  • 26
  • 46
1
2 3
99 100