Get stock quotes from Yahoo finance - yql

I have been trying to fetch the stock quotes from Yahoo finance, but I have not been able to get that.
I have tried YQL Console, and it is working fine in that https://developer.yahoo.com/yql/console/#h=select+*+from+pm.finance+where+symbol%3D%22SBIN.BO%22.
Here they are using pm.finance table to fetch the stock quote.
URL for accessing the REST URL it in browser here
If you will try to open the rest URL in the browser it gives you error:
{"error":{"lang":"en-US","description":"Authentication Error. The table pm.finance requires a higher security level than is provided, you provided ANY but at least APP is expected"}}
So for this I created a Yahoo App for this, so that I will be able to access using CURL request
Created App on - https://developer.yahoo.com/apps/
But now I am not able to get how to use this app to make a CURL request and get the quotes.
I have also tried http://download.finance.yahoo.com/d/quotes.csv?s=sbin.bo&f=sl1d1t1c1ohgv
But here I am not getting information about the quotes.
Please help me, how to get the stock quotes. I also know about Google finance API and have implemented that but client is specific about using Yahoo API.
Thanks in advance

Yahoo has discontinued their stock quote API. Try the Investor's Exchange API instead.

Related

Issues getting Youtube API WordPress plugin Restricted

I’m still having no luck getting this Youtube API Restricted properly.
Every time I try to give it HTTP referrers Restrictions & add the following Website Restrictions:
https://www.ohiocannabis.com
https://www.ohiocannabis.com/*
I then get the following error in my Youtube video player on my website: http://www.ohiocannabis.com/videos
Sorry, there was a YouTube API error: The referrer https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&playlistId=UUkbzQe9G_drgd3QoLmHZNfw&maxResults=15&key=AIzaSyArOPULA9UG52ZQUO7ddZMxrpC6odiFW4I does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions. Please make sure you performed the steps in this video to create and save a proper server API key.
I've also tried using the IP Restriction, the IP for my website is: 107.154.147.253
But when I use that the player gives me the following error:
Sorry, there was a YouTube API error: The calling IP address 50.116.78.101 does not match the IP restrictions configured on the API key. Please use the API Console to update your key restrictions.
So who/what/where is this “Calling IP” coming from that it would have a much different IP than my website domain?
(I unrestricted it so that my videos populate for now, so you may not see that error message on my Videos page)
Any idea on what I’m doing wrong to get this plugin to Restrict & work properly?
Thank you!!
I've tried adding HTTP Restrictions and also IP Restrictions, both with no luck.
I haven't tried any code yet, not sure what to do.
Sorry, there was a YouTube API error: The referrer https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&playlistId=UUkbzQe9G_drgd3QoLmHZNfw&maxResults=15&key=AIzaSyArOPULA9UG52ZQUO7ddZMxrpC6odiFW4I does not match the referrer restrictions configured on your API key. Please use the API Console to update your key restrictions. Please make sure you performed the steps in this video to create and save a proper server API key.
Sorry, there was a YouTube API error: The calling IP address 50.116.78.101 does not match the IP restrictions configured on the API key. Please use the API Console to update your key restrictions.
So I think I figured it out, I was adding a double restriction on this API by doing the HTTP and the API Restrictions option at the bottom.
I've removed the HTTP Restriction and just kept the API Restriction enabled to the Youtube Data API v3 and it seems to not be giving me the error any longer and showing all of my videos and google console is showing it is in fact now a Restricted API.
Does this sound like I did it right this time?
Thank you!

Fetch LinkedIn Contacts/Connections

How to Fetch LinkedIn Contacts in iOS ?
I read their API but in that api to fetch connections are not available any more. Is there are other alternate way to do it ?
I tried OAUTH2 but by that I can only login and get user basic info.
This is how its done in Android . here
As it's mentioned here :
LinkedIn has restricted their open API access, and this no longer works.
This question may be possible duplicate question to: linkedin-api-get-information-about-my-all-connections
As stated here:
https://developer.linkedin.com/support/developer-program-transition
the access for connections have been removed from the public API. You can only get access if you apply to a Partner Program which requires an official review of your app.
The example code you posted for Android doesn't actually use the public API to get the connections, it uses the API to get an access token and then uses the following URL to get the connections in CSV format and shows it in a WebView:
https://www.linkedin.com/people/export-settings?exportNetwork=Export&outputType=microsoft_outlook
If you don't want to use a WebView, you could possible download the CSV output, and parse it to get the actual data.
To parse the CSV you can use a CSV library like the following:
https://github.com/davedelong/CHCSVParser

How to integrate TripAdvisor with IOS APP?

In my app i need to integrate it with TripAdvisor API.
i searched a lot about it, i found this in there website:
https://developer-tripadvisor.com/content-api/
it's actually un useful!.
I didn't find any example or demo for this integration!
Anyone knows how to integrate with TripAdvisor in IOS? Or have any example about it?
thanks
Well, just like most APIs, you first have to get your API key from TripAdvisor. So go to the Request API Access form and fill that out (You have to sign up for Trip Advisor first, or sign in with a Facebook or Google account). They will then contact you with your API key and info.
Now that you have the key, the more interesting part takes place. You can use the app in HTTP requests in your app (Example Here) with the URL of the request you want to make. For example, if I wanted to get results for hotels with my coordinates, I would use this URL:
http://api.tripadvisor.com/api/partner/2.0/map/42.33141,-71.099396/hotels?key=<YOUR KEY HERE>
The response would be some JSON code which you can parse with Swift's built-in JSON parser, NSJSONSerialization. With this data, you can now store and make use of what you needed from their API.
To see the full API documentation of all the requests you can do and their details, just visit the TripAdvisor API Documentation.
Hope this helps,
Gabriel

Keep receiving REQUEST_DENIED for Google Places for iOS

I keep receiving REQUEST_DENIED when trying to use Google Places Autocomplete for iOS.
The example link is https://maps.googleapis.com/maps/api/place/autocomplete/json?input=londo&location=45.647157,25.628332&key=AIzaSyCHRmOeUQCcI_1JbcWiJ (I have ommited some of the last characters of the key)
Both Google Places API and Google Maps API are enabled from Google Developer Console
I have a valid key in Credentials section, for which I also added my bundle identifier in the list of bundle identifiers
The key is an iOS applications key, in Public API access section. It's valid and is created by me (owner)
Can anyone point me out to the good direction ?
Thanks in advance.
I found the problem: you need to enable the Google Places Web Services as well and use the server key (Funny enough, this thing is not specified in any of their docs)
Directions API require not iOS key, but server key. When you'll create server key, leave text view blank, do not enter your bundle name.
Use Browser key or server key for Google Places Autocomplete API. Keep the referrer field as empty. Make sure you enable Google Places API in the developers console.
I met the same problem last week and struggled for quite a while. The way I solved the problem is to follow the Google Places API for iOS https://developers.google.com/places/ios/start. Use GMSPlacesClient instead of JSON calls.

Google Places API: iOS key: Request Denied [duplicate]

I'm trying to make an Autocomplete field which should fetch cities as the user types, by using the Google Places API as described in this tutorial:
https://developers.google.com/places/training/autocomplete-android
You've probably found this question around many times before as I did, but none of the answers helped me. Here are the things you should know:
The URL is
https://maps.googleapis.com/maps/api/place/autocomplete/json?sensor=false&key=myKey&components=country:ro&input=whatTheUserTypes
Please don't reply by saying you replaced the API key with your own and it worked - the API key which goes there must be Android specific and won't work from a browser.
So did I make the Android API key using the SHA1 fingerprint obtained from the keystore I signed the app with.
I turned on Maps and Places APIs from the console.
The quota isn't exceeded.
All those and it still gives me REQUEST_DENIED
What I didn't mention is that I have O2Auth activated - does that change anything? Shouldn't it be as simple as putting the API key in the app?
Thanks!
Although this has been answered, I think the community could do better.
I was tearing my hair out about this, it just didn't make sense to me.. I was making an iOS/Android App, so I made an iOS/Android Key...
Wrong.
With Google's Places API, your bundle identifier isn't even considered.
What you really want to do is this:
(I'm using the new User Interface)
1. Log into https://cloud.google.com/console#/project
Select your Project Name, then go into API's & Auth > APIs
Make sure you have Places API Turned on. This is the only thing that needs to be turned on for Places-API to work.
2. Go into Credentials
Click CREATE NEW KEY under Public API Access
3. Select BROWSER KEY
4. Click Create, Nothing Else
Leave the HTTP Refer box empty.
5. Use the Key Generated here
This key will allow ANY user from any device access to the API via your Developer login.
You can try it out here: (Be sure to replace YOUR_KEY_HERE with your generated Key)
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Food%20Sh&sensor=false&radius=500&location=0,0&key=YOUR_KEY_HERE
6. Enjoy
Now you can use that URL above in your Android/iOS device.
The Google Places API does not currently support Android or iOS keys generated from the Google APIs Console. Only Server and Browser keys are currently supported.
If you would like to request this support, please file a Places API - Feature Request.
https://developers.google.com/places/training/autocomplete-android
Storing your API key
Although the above code demonstrates how to communicate directly
between an Android app and the Places Autocomplete service, you should
not store your Places API key with your app.
You should therefore build a web application that stores your API key
and proxies the Places API services. In order to secure communication
between your Android app and the proxy web service, you should require
user authentication to your proxy web service. Your Android app can
securely store user credentials and pass them to your web service, or
the user can log into your web app via an Android WebView.
For the latter approach, your web app should create and return a user
authentication token to your Android app, and your Android app should
subsequently pass this token to your proxy web service.
Go to google cloud platform console>Credentials click on edit by selected your YOUR_API_KEY>Application restrictions > select none option>save thats it.
If you select the android apps option from Application restrictions then google deny the place API with exception REQUEST_DENIED.
In Google dev console, you should be able to find both "Places API" and "Places API for Android"
Make sure to use "Places API for Android"
For some reason, "Places API for Android" is hidden in the API list, but can be accessed using search.
I had the same issue , I fix it by leaving
Accept requests from these HTTP referrers (web sites) (Optional)
in browser key Empty
I am still new, so I cannot comment, but to shed some light on Moe's answer, I resolved some similar Google Maps API issues regarding URL queries (for directions, using Volley) with the following steps:
Get Android API Key (including Google Maps Directions API in my case).
Get "Server" API Key (which seems to be created by using a key restriction of "HTTP referrers" these days - really, it's just used to issue URL queries through HTTP).
Store the Android API key as a meta-data tag in the application tag in AndroidManifest.xml with android:name="com.google.android.maps.v2.API_KEY" and android:value as your key. This is used for direct interaction with the Maps API (minus URL queries).
Use the server API key whenever issuing URL queries.
I am not sure if this also applies to URL queries for the Places API, if you only need the server API key, or if there is a better solution, but this worked for me.
I imagine that it works with just the first key - the one not restricted to Android.
Inside Google Cloud Console type Places and Activate it. Create an API Key and insert it onto your Android Studio App as you would do normally. That`s it.
I had the same problem. For me the key was to enable billing on project. I am still using "Applications for Android" restrictions. After setting up the payment method, Places Api started working.
Prior to using the Places SDK for Android, do the following:
Follow the Get an API Key guide to get, add, and restrict an API key.
Enable billing on each of your projects.
Enable the Places API for each of your projects.
See it there.
Be sure also to check out the billing plans for the Google Places API as it is not free!

Resources