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.

Filter by
Sorted by
Tagged with
346 votes
14 answers
1.1m views

REST API Best practices: Where to put parameters? [closed]

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 ...
Kalle Gustafsson's user avatar
137 votes
9 answers
706k views

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

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 ...
Bogdan's user avatar
  • 5,378
127 votes
5 answers
317k views

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. ...
rbrayb's user avatar
  • 46.5k
116 votes
6 answers
549k views

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&...
Maaz's user avatar
  • 4,203
116 votes
5 answers
130k views

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 ...
bimasakti's user avatar
  • 1,369
114 votes
2 answers
168k views

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

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-...
0x1ad2's user avatar
  • 8,014
114 votes
28 answers
17k views

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 ...
izb's user avatar
  • 50.2k
114 votes
2 answers
45k views

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 ...
Shauna's user avatar
  • 9,515
114 votes
15 answers
121k views

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 ...
Dip Dhingani's user avatar
  • 2,499
111 votes
16 answers
483k views

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 ...
undefined's user avatar
  • 5,200
109 votes
12 answers
149k views

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/...
Vinesh EG's user avatar
  • 1,325
108 votes
5 answers
207k views

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][...
tdous's user avatar
  • 1,599
107 votes
7 answers
74k views

Scala framework for a Rest API Server? [closed]

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 ...
fesja's user avatar
  • 3,313
106 votes
9 answers
181k views

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 ...
Eric's user avatar
  • 1,253
105 votes
11 answers
172k views

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 ...
Saariko's user avatar
  • 1,703
104 votes
11 answers
150k views

Stock ticker symbol lookup API [closed]

Is there any sort of API that just offers a simple symbol lookup service? i.e., input a company name and it will tell you the ticker symbol? I've tried just screen-scraping Google Finance, but after a ...
dancavallaro's user avatar
  • 13.1k
103 votes
2 answers
117k views

How to use API Routes in Laravel 5.3

In Laravel 5.3 API routes were moved into the api.php file. But how can I call a route in api.php file? I tried to create a route like this: Route::get('/test',function(){ return "ok"; }); I ...
user avatar
101 votes
5 answers
121k views

Securing Spring Boot API with API key and secret

I would like to secure the Spring Boot API so it is accessible only for the clients that has valid API key and secret. However, there is no authentication (standard login with username and password) ...
Vitalii Oleksiv's user avatar
101 votes
4 answers
46k views

API to automatically upload apk to Google Play? [closed]

Is there any API or tool that enables me to automatically upload an APK to Google Play? I want to automatically publish customized apps to my account without any manual steps or graphical interface. ...
Magnus's user avatar
  • 3,691
100 votes
3 answers
267k views

How can I use the WhatsApp API from Java or Python? [duplicate]

I am looking for WhatsApp API, preferably a Python or Java library. I've tried Yowsup, but could not get my number registered; I am based in India and I am not sure if that has got anything to do ...
rishi's user avatar
  • 2,564
99 votes
2 answers
119k views

How to detect when a youtube video finishes playing?

I am working on a site that has a ton of embedded youtube videos, the client wants to show a popup whenever a video stops splaying. I looked at the youtube api and there seems to be a way to detect ...
user avatar
98 votes
5 answers
50k views

Java: bounded wildcards or bounded type parameter?

Recently, I read this article: http://download.oracle.com/javase/tutorial/extra/generics/wildcards.html My question is, instead of creating a method like this: public void drawAll(List<? extends ...
Tony Le's user avatar
  • 983
98 votes
10 answers
79k views

pinterest api documentation [closed]

Update Aug 2015: Pinterest provides it here now https://dev.pinterest.com/ Is there official or unofficial documentation on the v2 Pinterest API? Things I know: JSON api is in version 2. https://...
Dylan Valade's user avatar
  • 5,565
98 votes
6 answers
107k views

Best/Most Comprehensive API for Stocks/Financial Data [closed]

What is the most recommended free/public API for accessing financial market stats and stock quotes (preferrably real-time quotes)? I'm not too picky about how it's exposed (SOAP, REST, some ...
Wilco's user avatar
  • 32.8k
96 votes
2 answers
73k views

How to store data in S3 and allow user access in a secure way with rails API / iOS client?

I am new to writing Rails and APIs. I need some help with S3 storage solution. Here's my problem. I am writing an API for an iOS app where the users login with the Facebook API on iOS. The server ...
dineth's user avatar
  • 9,832
95 votes
14 answers
79k views

Auto Shutdown and Start Amazon EC2 Instance

Can I automatically start and terminate my Amazon instance using Amazon API? Can you please describe how this can be done? I ideally need to start the instance and stop the instance at specified time ...
Pasta's user avatar
  • 2,491
95 votes
4 answers
27k views

Using secret api keys on travis-ci

I'd like to use travis-ci for one of my projects. The project is an API wrapper, so many of the tests rely on the use of secret API keys. To test locally, I just store them as environment variables. ...
user94154's user avatar
  • 16.2k
94 votes
3 answers
48k views

Most suitable python library for Github API v3 [closed]

I am looking for a python library for the Github APIv3 suitable for me. I found one library (python-github3) mentioned in the GH API docs. After playing around with it in ipython for an hour or two, ...
Christoph's user avatar
  • 5,480
93 votes
6 answers
90k views

Set timeout for HTTPClient get() request

This method submits a simple HTTP request and calls a success or error callback just fine: void _getSimpleReply( String command, callback, errorCallback ) async { try { ...
SteAp's user avatar
  • 11.9k
92 votes
10 answers
119k views

How do I return an image in fastAPI?

Using the python module fastAPI, I can't figure out how to return an image. In flask I would do something like this: @app.route("/vector_image", methods=["POST"]) def image_endpoint(): # img = ......
Hooked's user avatar
  • 84.6k
92 votes
6 answers
67k views

How to post in Google+ wall

I want to share some information in Google+ wall from my application. For that I go through the Google+ API. In that API they are mentioning how to get access token of a particular user, but they do ...
Karthi Ponnusamy's user avatar
90 votes
7 answers
72k views

aws api gateway & lambda: multiple endpoint/functions vs single endpoint

I have an AWS api that proxies lamba functions. I currently use different endpoints with separate lambda functions: api.com/getData --> getData api.com/addData --> addData api.com/signUp --> ...
Chris's user avatar
  • 13.2k
89 votes
10 answers
140k views

Automated testing for REST Api [closed]

I would like to write an automated testing suite for a REST API. As we complete new services, we'd like to check to make sure all the previously created services are working as expected. Any ...
user avatar
88 votes
4 answers
96k views

Is setting Roles in JWT a best practice? [closed]

I am considering to use JWT. In the jwt.io example I am seeing the following information in the payload data: "admin": true Admin can be considered as a Role, hence my question. Is setting the role ...
ayorosmage's user avatar
  • 1,627
87 votes
3 answers
41k views

Twitter api text field value is truncated

why text field value is truncated and how can i get complete value. As of now i am trying to get text field value like below do { if let responseObject = try NSJSONSerialization....
Sheshnath's user avatar
  • 3,313
84 votes
1 answer
28k views

How to secure an API REST for mobile app? (if sniffing requests gives you the "key")

It's probable a newbie question but I'll try to create an interesting debate. I know there are some authentication methods for API Basic Authentication, API Keys, OAuth 2.0 ... all of those methods ...
FlamingMoe's user avatar
  • 2,779
84 votes
7 answers
80k views

How does a site like kayak.com aggregate content? [closed]

Greetings, I've been toying with an idea for a new project and was wondering if anyone has any idea on how a service like Kayak.com is able to aggregate data from so many sources so quickly and ...
Jeff's user avatar
  • 2,818
84 votes
6 answers
58k views

Return the current user with Django Rest Framework

I am currently developing an API using Django. However, I would like to create a view that returns the current User with the following endpoint: /users/current/. To do so, I created a list view and ...
Maxime's user avatar
  • 1,776
84 votes
10 answers
85k views

Cheapest way to send SMS for number verification? [closed]

My application needs to verify phone numbers that are provided by the user. What is the absolute cheapest way to send an SMS to a phone? Which company/API should I go to? I'm not looking for a hack ...
erotsppa's user avatar
  • 14.3k
83 votes
8 answers
67k views

Getting my public IP via API [closed]

Is there a public API from some big company to get my public ip from within a program? I've found http://ip-address.domaintools.com/myip.xml, which is exactly what I want, but unfortunately it ...
Slava V's user avatar
  • 16.7k
83 votes
8 answers
98k views

Timezone lookup from latitude longitude [closed]

Is there any library (or even better, web service) available which can convert from a latitude/longitude into a time zone?
Matt Sheppard's user avatar
81 votes
8 answers
235k views

cURL POST command line on WINDOWS RESTful service

My problem: Using the command line tool to curl my localhost server while sending some data along with my POST request is not working. What seems to be causing the error: Imagine something like ...
Lothre1's user avatar
  • 3,523
81 votes
2 answers
22k views

Is devise's token_authenticatable secure?

I'm building a simple api with Rails API, and want to make sure I'm on the right track here. I'm using devise to handle logins, and decided to go with Devise's token_authenticatable option, which ...
Jeff Escalante's user avatar
79 votes
6 answers
135k views

Best way to generate xml? [duplicate]

I'm creating an web api and need a good way to very quickly generate some well formatted xml. I cannot find any good way of doing this in python. Note: Some libraries look promising but either lack ...
Joshkunz's user avatar
  • 5,575
79 votes
10 answers
220k views

Address validation using Google Maps API

I have a task to validate addresses entered into a system I am currently creating. The system requires that address entered are validated against a valid data source. In the UK the dataset comes from ...
Paul's user avatar
  • 1,815
78 votes
1 answer
58k views

Java 7 new IO API - Paths.exists [duplicate]

Does anyone know what happened to the path.exists() API method in the latest Java 7 API? I cannot find the change in the change logs, and between b123 and b130, the method has been removed from the ...
Eugen's user avatar
  • 8,553
78 votes
3 answers
36k views

Storing authentication tokens on iOS - NSUserDefaults vs Keychain?

Which is the place I should be storing tokens for when the user logins in to a service? I'm not saving passwords (obviously where I'd use the Keychain) but just the token. A lot of places say just use ...
Doug Smith's user avatar
  • 29.7k
78 votes
5 answers
38k views

How does Google Maps secure their API Key? How to make something similar?

Currently Google requires you to create an API Key that is specific to the domain of where the map will be served from. How does Google enforce this? I want to do the same thing. I expose an API for ...
Vyrotek's user avatar
  • 5,356
77 votes
12 answers
104k views

GUI frontend for cURL for testing an API [closed]

I'm (manually) testing a RESTful API that makes full use of GET/POST/PUT/DELETE methods. Rather than using cURL on the command line to quickly test different input options, it would be handy if there ...
AdamTheHutt's user avatar
  • 8,307
77 votes
2 answers
48k views

Should null values be included in JSON responses from a REST API? [closed]

I'm in the process of designing and developing a RESTful API. I'm taking a pragmatic, resource oriented approach to the API (resource oriented, uniform interface, addressability, but no real HATEOAS). ...
Dennis Laumen's user avatar

1
2 3 4 5
2135