Option symbol 'GOOG' not working in YQL - yahoo-finance

I am trying to retrieve options data from Yahoo Finance using YQL. The very strange problem is that I can download the desired options data for other symbols such as AAPL (Apple) and MSFT (Microsoft), but not for GOOG (Google).
Here's my query and the result. Obviously I can retrieve data for AAPL and MSFT, but GOOG is missing. This happens not only with yahoo.finance.option_contracts, but also with all other option-related tables including yahoo.finance.options. I am pretty sure that this is not something related to the query limits, since the query shown below is expected to retrieve only less than 10 results for GOOG.
select * from yahoo.finance.option_contracts where symbol in ( 'GOOG', 'AAPL', 'MSFT')
{
"query": {
"count": 2,
"created": "2014-03-03T15:00:45Z",
"lang": "en-US",
"diagnostics": {
"url": [
{
"execution-start-time": "0",
"execution-stop-time": "1",
"execution-time": "1",
"content": "http://www.datatables.org/yahoo/finance/yahoo.finance.option_contracts.xml"
},
{
"execution-start-time": "4",
"execution-stop-time": "1057",
"execution-time": "1053",
"content": "http://finance.yahoo.com/q/op?s=MSFT"
},
{
"execution-start-time": "5",
"execution-stop-time": "3571",
"execution-time": "3566",
"content": "http://finance.yahoo.com/q/op?s=AAPL"
},
{
"error": "Connect Failure",
"execution-start-time": "5",
"execution-stop-time": "10017",
"execution-time": "10012",
"content": "http://finance.yahoo.com/q/op?s=GOOG"
},
{
"error": "Connect Failure",
"execution-start-time": "5",
"execution-stop-time": "10017",
"execution-time": "10012",
"content": "http://finance.yahoo.com/q/op?s=GOOG"
}
],
"publiclyCallable": "true",
"javascript": [
{
"execution-start-time": "3",
"execution-stop-time": "1074",
"execution-time": "1070",
"instructions-used": "18571",
"table-name": "yahoo.finance.option_contracts"
},
{
"execution-start-time": "3",
"execution-stop-time": "3616",
"execution-time": "3612",
"instructions-used": "31142",
"table-name": "yahoo.finance.option_contracts"
},
"Exception: Read timed out, url: http://finance.yahoo.com/q/op?s=GOOG",
{
"execution-start-time": "3",
"execution-stop-time": "10017",
"execution-time": "10013",
"instructions-used": "31142",
"table-name": "yahoo.finance.option_contracts"
}
],
"user-time": "10018",
"service-time": "19447",
"build-version": "0.2.2157"
},
"results": {
"option": [
{
"symbol": "AAPL",
"contract": [
"2014-03",
"2014-04",
"2014-05",
"2014-06",
"2014-07",
"2014-10",
"2015-01",
"2016-01"
]
},
{
"symbol": "MSFT",
"contract": [
"2014-03",
"2014-04",
"2014-05",
"2014-06",
"2014-07",
"2014-10",
"2015-01",
"2016-01"
]
}
]
}
}
}
In sum, every time I try to retrieve options data for GOOG, I only get null result with the error of 'Read Timed Out'. For other option symbols such as AAPL and MSFT, I get what I desire.
Anyone knows why this is so?

This must have to do with Google the company trading under TWO stickers (See http://finance.yahoo.com/news/google-trades-under-2-tickers-225300863.html): GOOG and GOOGL.
YQL doesn't recognize GOOG, but will accept the new ticker GOOGL. I suspect the YQL query errors out on getting unexpectedly two tickers instead of one when looking for just GOOG.
If you request a GOOG quote on Yahoo!Finance, it works.

Related

Unable to visualize series correctly on custom timeline (Error, unable to access property 0, c.points is undefined)

I am attempting to cluster a rather large amount of data segments into Series on a timeline chart. Initially, enabling the sections on the legend plotted each data point as a filterable section, but I am unable to correctly get it working with the individual series.
Here is the code being used at present:
$.ajax({
type: "GET",
url: '/newestccoi/api/ccoi_visualization_engine.php',
dataType: "json",
data: {
sid: <?php echo $_GET['sid'] ?>
},
success: function(res) {
const time = new Highcharts.Time();
var data = [];
console.log(res);
let constructedSeries = [];
function toDateTime(secs) {
var t = new Date(1970, 0, 1);
t.setSeconds(secs);
return t;
};
let distance = 50;
for (value of Object.values(res)) {
let seriesEntry = {};
const arr_start = value[0];
const arr_end = value[value.length - 1];
//Construct our Data array with ALL entries in a given subsession
for (let i = 0; i < value.length; i++) {
let tempObj = value[i];
let obsTime = toDateTime(tempObj.seconds);
temp_data = {
name: tempObj.notes,
label: tempObj.name,
description: arr_start.sublabel,
x: obsTime.getTime(),
};
data.push(temp_data);
}
//Craft individual series entry (object) with the data object.
console.log(distance);
seriesEntry = {
dataLabels: {
allowOverlap: true,
distance: distance,
format: '<span style="color:{point.color}">● </span><span style="font-weight: bold;" > ' +
'{point.x:%M:%S}</span><br/>{point.label}'
},
marker: {
symbol: 'circle'
},
data: data
};
constructedSeries.push(seriesEntry);
//Clear data object;
data = [];
distance += 50;
}
Highcharts.chart('container', {
chart: {
type: 'timeline',
zoomType: 'x'
},
accessibility: {
screenReaderSection: {
beforeChartFormat: '<h5>{chartTitle}</h5>' +
'<div>{typeDescription}</div>' +
'<div>{chartSubtitle}</div>' +
'<div>{chartLongdesc}</div>' +
'<div>{viewTableButton}</div>'
},
point: {
valueDescriptionFormat: '{index}. {point.label}. {point.description}.'
}
},
xAxis: {
type: 'datetime',
labels: {
format: '{value:%M:%S}'
},
visible: true
},
yAxis: {
visible: false
},
legend: {
enabled: true
},
title: {
text: 'Session path timeline visualization'
},
subtitle: {
text: 'CCOI</a>'
},
colors: [
'#4185F3',
'#427CDD',
'#406AB2',
'#3E5A8E',
'#3B4A68',
'#363C46'
],
plotOptions: {
timeline:{
legendType: '',
colorByPoint: false,
showInLegend: true,
}
},
series: constructedSeries
});
},
error: function(xhr) {
//Do something to handle our error.
console.log(xhr);
}
})
Introducing the code necessary to properly display the individual Series on the legend, legendType: '', broke the timeline and returned the following Javascript Error:
Uncaught TypeError: can't access property 0, c.points is undefined
Any help on this matter would be greatly appreciated! I am including a sample piece of JSON to rid any confusion on what exactly this data looks like. If believes there's a better way of doing this in Highchart, I'm open to completely redoing it as well! I have a feeling this may have to do with the fact I am using a hacky method of changing the time scale on the timeline to Minutes and Seconds, but I am not absolutely sure.
{
"1": [
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "1",
"notes": "Student is trying to draw star in Scratch.",
"seconds": "0",
"name": "start"
},
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "1",
"notes": null,
"seconds": "30",
"name": "independent"
}
],
"2": [
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "2",
"notes": "Student asks for peer's help with problem.",
"seconds": "30",
"name": "start"
},
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "2",
"notes": null,
"seconds": "30",
"name": "interactive"
},
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "2",
"notes": null,
"seconds": "30",
"name": "problem_solving"
},
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "2",
"notes": null,
"seconds": "90",
"name": "problem_solving"
},
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "2",
"notes": null,
"seconds": "90",
"name": "problem_solving"
},
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "2",
"notes": null,
"seconds": "90",
"name": "interactive"
}
],
"3": [
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "3",
"notes": "Student opens Google Maps.",
"seconds": "90",
"name": "start"
},
{
"sid": "1",
"sublabel": "Problem 1",
"subsession": "3",
"notes": null,
"seconds": "135",
"name": "independent"
}
],
"4": [
{
"sid": "1",
"sublabel": null,
"subsession": "4",
"notes": null,
"seconds": "135",
"name": "start"
},
{
"sid": "1",
"sublabel": null,
"subsession": "4",
"notes": null,
"seconds": "135",
"name": "interactive"
},
{
"sid": "1",
"sublabel": null,
"subsession": "4",
"notes": null,
"seconds": "165",
"name": "non_computing_communication"
},
{
"sid": "1",
"sublabel": null,
"subsession": "4",
"notes": null,
"seconds": "170",
"name": "interactive"
},
{
"sid": "1",
"sublabel": null,
"subsession": "4",
"notes": null,
"seconds": "170",
"name": "problem_solving"
},
{
"sid": "1",
"sublabel": null,
"subsession": "4",
"notes": null,
"seconds": "170",
"name": "problem_solving"
},
{
"sid": "1",
"sublabel": null,
"subsession": "4",
"notes": null,
"seconds": "180",
"name": "problem_solving"
},
{
"sid": "1",
"sublabel": null,
"subsession": "4",
"notes": null,
"seconds": "180",
"name": "interactive"
}
]
}
I attempted to follow the help of this a separate stackoveflow post that goes over the method for using multiple series within a timeline, but nothing there seemed to be the cause of why I am getting this error.
Edit
Chart when legendType is default
Chart when legendType is unset to ''
My goal is to actually have the legend correctly display 1-10 like in the second image, while actually displaying the data. When legendType is set, for some reason or another it treats every individual data object in the data array as a series, when it should actually be display the 10 series objects that are present in the array.
If this still doesn't clear things up, let me know and I'll create a codepen!

Yahoo public api returning result as null. What is the other alternative to get the frre list of stock data live

I used below api:
https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22AVGO%22)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=
It is returning below json:
{
"query": {
"count": 0,
"created": "2017-12-15T10:17:09Z",
"lang": "en-US",
"diagnostics": {
"redirect": [{
"from": "/ec?url=http%3a%2f%2fwww.datatables.org%2fyahoo%2ffinance%2fyahoo.finance.quotes.xml&t=1513333026&ttl=60&sig=5p8s71uMOfbvHH8Cx7iHVQ--~D",
"status": "307",
"content": "http://www.datatables.org/yahoo/finance/yahoo.finance.quotes.xml"
}, {
"from": "/ec?url=http%3a%2f%2fdownload.finance.yahoo.com%2fd%2fquotes.csv%3ff%3daa2bb2b3b4cc1c3c4c6c8dd1d2ee1e7e8e9ghjkg1g3g4g5g6ii5j1j3j4j5j6k1k2k4k5ll1l2l3mm2m3m4m5m6m7m8nn4opp1p2p5p6qrr1r2r5r6r7ss1s7t1t7t8vv1v7ww1w4xy%26s%3dAVGO&t=1513333029&ttl=60&sig=lMli2lKRDkqtxVXcjK.Vyg--~D",
"status": "307",
"content": "http://download.finance.yahoo.com/d/quotes.csv?f=aa2bb2b3b4cc1c3c4c6c8dd1d2ee1e7e8e9ghjkg1g3g4g5g6ii5j1j3j4j5j6k1k2k4k5ll1l2l3mm2m3m4m5m6m7m8nn4opp1p2p5p6qrr1r2r5r6r7ss1s7t1t7t8vv1v7ww1w4xy&s=AVGO"
}],
"url": [{
"execution-start-time": "0",
"execution-stop-time": "2",
"execution-time": "2",
"content": "http://www.datatables.org/yahoo/finance/yahoo.finance.quotes.xml"
}, {
"execution-start-time": "2504",
"execution-stop-time": "2509",
"execution-time": "5",
"http-status-code": "403",
"http-status-message": "Forbidden",
"content": "http://download.finance.yahoo.com/d/quotes.csv?f=aa2bb2b3b4cc1c3c4c6c8dd1d2ee1e7e8e9ghjkg1g3g4g5g6ii5j1j3j4j5j6k1k2k4k5ll1l2l3mm2m3m4m5m6m7m8nn4opp1p2p5p6qrr1r2r5r6r7ss1s7t1t7t8vv1v7ww1w4xy&s=AVGO"
}],
"publiclyCallable": "true",
"cache": {
"error": "Timed out waiting for operation - failing node: memcache3.yql.gq1.yahoo.com/206.190.36.58:11211",
"execution-start-time": "3",
"execution-stop-time": "2503",
"execution-time": "2500",
"method": "GET",
"type": "MEMCACHED",
"content": "5d1e1de680846a307c9874dc3d6878dc"
},
"javascript": ["Unable to retrieve query results from cache, Timed out waiting for operation - failing node: memcache3.yql.gq1.yahoo.com/206.190.36.58:11211", {
"execution-start-time": "2",
"execution-stop-time": "2509",
"execution-time": "2506",
"instructions-used": "12000",
"table-name": "yahoo.finance.quotes"
}],
"csv": "Column mismatch: [Ask, AverageDailyVolume, Bid, AskRealtime, BidRealtime, BookValue, Change&PercentChange, Change, Commission, Currency, ChangeRealtime, AfterHoursChangeRealtime, DividendShare, LastTradeDate, TradeDate, EarningsShare, ErrorIndicationreturnedforsymbolchangedinvalid, EPSEstimateCurrentYear, EPSEstimateNextYear, EPSEstimateNextQuarter, DaysLow, DaysHigh, YearLow, YearHigh, HoldingsGainPercent, AnnualizedGain, HoldingsGain, HoldingsGainPercentRealtime, HoldingsGainRealtime, MoreInfo, OrderBookRealtime, MarketCapitalization, MarketCapRealtime, EBITDA, ChangeFromYearLow, PercentChangeFromYearLow, LastTradeRealtimeWithTime, ChangePercentRealtime, ChangeFromYearHigh, PercebtChangeFromYearHigh, LastTradeWithTime, LastTradePriceOnly, HighLimit, LowLimit, DaysRange, DaysRangeRealtime, FiftydayMovingAverage, TwoHundreddayMovingAverage, ChangeFromTwoHundreddayMovingAverage, PercentChangeFromTwoHundreddayMovingAverage, ChangeFromFiftydayMovingAverage, PercentChangeFromFiftydayMovingAverage, Name, Notes, Open, PreviousClose, PricePaid, ChangeinPercent, PriceSales, PriceBook, ExDividendDate, PERatio, DividendPayDate, PERatioRealtime, PEGRatio, PriceEPSEstimateCurrentYear, PriceEPSEstimateNextYear, Symbol, SharesOwned, ShortRatio, LastTradeTime, TickerTrend, OneyrTargetPrice, Volume, HoldingsValue, HoldingsValueRealtime, YearRange, DaysValueChange, DaysValueChangeRealtime, StockExchange, DividendYield] vs Yahoo! - 403 Forbidden -- error 403It has come to our attention that this service is being used in violation of the Yahoo Terms of Service. As such, the service is being discontinued. For all future markets and equities data research, please refer to finance.yahoo.com.",
"query": {
"execution-start-time": "2503",
"execution-stop-time": "2509",
"execution-time": "6",
"params": "{url=[http://download.finance.yahoo.com/d/quotes.csv?f=aa2bb2b3b4cc1c3c4c6c8dd1d2ee1e7e8e9ghjkg1g3g4g5g6ii5j1j3j4j5j6k1k2k4k5ll1l2l3mm2m3m4m5m6m7m8nn4opp1p2p5p6qrr1r2r5r6r7ss1s7t1t7t8vv1v7ww1w4xy&s=AVGO]}",
"content": "select * from csv where url=#url and columns='Ask,AverageDailyVolume,Bid,AskRealtime,BidRealtime,BookValue,Change&PercentChange,Change,Commission,Currency,ChangeRealtime,AfterHoursChangeRealtime,DividendShare,LastTradeDate,TradeDate,EarningsShare,ErrorIndicationreturnedforsymbolchangedinvalid,EPSEstimateCurrentYear,EPSEstimateNextYear,EPSEstimateNextQuarter,DaysLow,DaysHigh,YearLow,YearHigh,HoldingsGainPercent,AnnualizedGain,HoldingsGain,HoldingsGainPercentRealtime,HoldingsGainRealtime,MoreInfo,OrderBookRealtime,MarketCapitalization,MarketCapRealtime,EBITDA,ChangeFromYearLow,PercentChangeFromYearLow,LastTradeRealtimeWithTime,ChangePercentRealtime,ChangeFromYearHigh,PercebtChangeFromYearHigh,LastTradeWithTime,LastTradePriceOnly,HighLimit,LowLimit,DaysRange,DaysRangeRealtime,FiftydayMovingAverage,TwoHundreddayMovingAverage,ChangeFromTwoHundreddayMovingAverage,PercentChangeFromTwoHundreddayMovingAverage,ChangeFromFiftydayMovingAverage,PercentChangeFromFiftydayMovingAverage,Name,Notes,Open,PreviousClose,PricePaid,ChangeinPercent,PriceSales,PriceBook,ExDividendDate,PERatio,DividendPayDate,PERatioRealtime,PEGRatio,PriceEPSEstimateCurrentYear,PriceEPSEstimateNextYear,Symbol,SharesOwned,ShortRatio,LastTradeTime,TickerTrend,OneyrTargetPrice,Volume,HoldingsValue,HoldingsValueRealtime,YearRange,DaysValueChange,DaysValueChangeRealtime,StockExchange,DividendYield'"
},
"user-time": "2509",
"service-time": "2507",
"build-version": "2.0.217"
},
"results": null
}
}
Yahoo shut their stock api down.
You can get live data using the yahoo_fin package. Its documentation is here: http://theautomatic.net/yahoo_fin-documentation/. You'll mainly need two functions from it -- get_data, and get_quote_table.
If you want live prices, you can do this:
from yahoo_fin.stock_info import get_data, get_quote_table
# get current price for Apple's stock
get_data("AAPL").close[-1]
Running the above code during the trading day will get you the current live price.
If you want other information, like what's available on the quote page (e.g. https://finance.yahoo.com/quote/AAPL?p=AAPL), you can use the get_quote_table function:
get_quote_table("AAPL")
So you just need to replace "AAPL" with whatever ticker symbols you want.
The yahoo_fin package also has functions to get ticker lists from the S&P, NASDAQ, and Dow -- so if you want to pull all the data for those, you can just loop the ticker lists those functions return.
from yahoo_fin.stock_info import tickers_dow
# get all Dow tickers
dow_tickers = tickers_dow()
# get price data for Dow stocks
dow_data = {ticker : get_data(ticker) for ticker in dow_tickers}

Using YQL to get Options Data

Using the YQL console I did:
select * from yahoo.finance.options where symbol="FB"
but I got the following result in JSON. There is no data in the optionsChain. Based on other posts I believe the request to be formatted correctly. How do I get the data that should be in the options chain? Is this out of date or am I missing something? Thanks in advance.
{
"query": {
"count": 1,
"created": "2015-01-10T17:26:16Z",
"lang": "en-US",
"diagnostics": {
"url": [
{
"execution-start-time": "0",
"execution-stop-time": "71",
"execution-time": "71",
"content": "http://www.datatables.org/yahoo/finance/yahoo.finance.options.xml"
},
{
"execution-start-time": "74",
"execution-stop-time": "1620",
"execution-time": "1546",
"content": "http://finance.yahoo.com/q/op?s=FB"
}
],
"publiclyCallable": "true",
"log": [
"results.length(): 0",
"no elements"
],
"javascript": {
"execution-start-time": "74",
"execution-stop-time": "1647",
"execution-time": "1573",
"instructions-used": "11272",
"table-name": "yahoo.finance.options"
},
"user-time": "1648",
"service-time": "1537",
"build-version": "0.2.278"
},
"results": {
"optionsChain": {
"symbol": "FB"
}
}
}
}
Lots of people having problems with this myself included.
After looking around I found out that Google's Option information is also available via JSON.
It's no good for production environments as it's unsupported and really just a function of how there site operates, but if your interested I did a tutorial with full sample code on it. Even better it's REST based so can be consumed fairly easily in any language.
Google Stock Option Chain Data

SurveyMonkey: Where is the text of my respondent's response?

I'm new to the SurveyMonkey API and it hasn't been too difficult to get payloads back from API calls, but right now I'm trying to get back what responses a specific respondent gave.
I have a survey which has two respondents, the first question on the survey asks the user to enter three pieces of information: Their Name, an ID and today's date.
So, if I do a call to get_survey_details, I can see the questions just fine. For example
obj.pages[0].questions[0].answers[0].answerid: "xxxxxxxx" //some long ID
obj.pages[0].questions[0].answers[0].text: "Enter Your Name"
obj.pages[0].questions[0].answers[0].type: "row"
There's a couple more pieces of information in that object, like whether the question is visible, etc., but these seem to be the pertinent pieces to the question I have.
So! I make another call to get_responses using the same survey_id and respondent_id (there's only two so actually I get them both).
In the resulting payload I get an array of 2 objects (one to hold each respondents responses). So I look in the first (obj[0]) and I see an array of questions and the respondent id. Fine. I look in the questions array and I see one object for each question and in each of those an answers object.
so that's:
obj[0].questions[0].answers[0].col: "yyyyyy" //some long ID
obj[0].questions[0].answers[0].row: "nnnnnn" //some other long ID
No response text. just this row/col business.
At this point, I'm super-confused (which is like regular confused, but with a cape). Where the heck are the respondents actual responses?
What the heck does "row" and "column" reference? Do I have to do some other API call with the row and/or column in order to get the text of the respondent's response?
I've looked through the documentation (and will continue to do so after posting this) and through stackoverflow to see if anyone else has asked this before. There was one question that came close, but really they were just forgetting to pair 'get_responses' with 'get_survey_details'. I'm doing that, but am still lost as ever. And I don't see any documentation really explaining in detail how this row/column concept works for mapping responses to the text of the response. :/
I know this is a really long-winded question, but I'm just so confused as to how to actually get responses out of this API. :(
Thanks for reading.
The text for a given response should come through under the "text" key. e.g. for a survey that only consists of an essay style question:
{
"status": 0,
"data": [
{
"respondent_id": "123456",
"questions": [
{
"answers": [
{
"text": "This is an essay style answer.",
"row": "0"
}
],
"question_id": "78910"
}
]
}
]
}
"row" and "col" literally reference the row and column of an answer - e.g. in a matrix question, there will be a list of rows for different questions ("what did you think of the hotel?") and ratings ("bad, okay, great") - and each answer is a combination of these. For a regular multiple choice question there will be multiple rows and only one column.
Calling "get_responses" with the correct respondent_id should provide you with the text response that you want. It's only the fixed details of the answer stored in the survey itself you should have to look up (provided in get_survey_details).
Using GET : /surveys/{survey_id}/details, we can get the corresponding question Ids along with the answer Ids.
{
"pages": [
{
"href": "https://api.surveymonkey.net/v3/surveys/87263608/pages/260492760",
"description": "",
"questions": [
{
"sorting": null,
"family": "matrix",
"subtype": "rating",
"required": {
"text": "This question requires an answer.",
"amount": "0",
"type": "all"
},
"answers": {
"rows": [
{
"visible": true,
"text": "",
"position": 1,
"id": "10788526669"
}
],
"choices": [
{
"description": "Not at all likely",
"weight": -100,
"id": "10788526670",
"visible": true,
"is_na": false,
"text": "Not at all likely - 0",
"position": 1
},
{
"description": "",
"weight": -100,
"id": "10788526671",
"visible": true,
"is_na": false,
"text": "1",
"position": 2
},
{
"description": "",
"weight": -100,
"id": "10788526672",
"visible": true,
"is_na": false,
"text": "2",
"position": 3
},
{
"description": "",
"weight": -100,
"id": "10788526673",
"visible": true,
"is_na": false,
"text": "3",
"position": 4
},
{
"description": "",
"weight": -100,
"id": "10788526674",
"visible": true,
"is_na": false,
"text": "4",
"position": 5
},
{
"description": "",
"weight": -100,
"id": "10788526675",
"visible": true,
"is_na": false,
"text": "5",
"position": 6
},
{
"description": "",
"weight": -100,
"id": "10788526676",
"visible": true,
"is_na": false,
"text": "6",
"position": 7
},
{
"description": "",
"weight": 0,
"id": "10788526677",
"visible": true,
"is_na": false,
"text": "7",
"position": 8
},
{
"description": "",
"weight": 0,
"id": "10788526678",
"visible": true,
"is_na": false,
"text": "8",
"position": 9
},
{
"description": "",
"weight": 100,
"id": "10788526679",
"visible": true,
"is_na": false,
"text": "9",
"position": 10
},
{
"description": "Extremely likely",
"weight": 100,
"id": "10788526680",
"visible": true,
"is_na": false,
"text": "Extremely likely - 10",
"position": 11
}
]
},
"visible": true,
"href": "https://api.surveymonkey.net/v3/surveys/87263608/pages/260492760/questions/1044924866",
"headings": [
{
"heading": "How likely is it that you would recommend XYZ to a friend or colleague?"
}
],
"position": 1,
"validation": null,
"id": "1044924866",
"forced_ranking": false
},
{
"sorting": null,
"family": "single_choice",
"subtype": "vertical",
"required": null,
"answers": {
"choices": [
{
"visible": true,
"text": "High Interest",
"position": 1,
"id": "10788529403"
},
{
"visible": true,
"text": "Long process",
"position": 2,
"id": "10788529404"
},
{
"visible": true,
"text": "Low XYZ Amount",
"position": 3,
"id": "10788529405"
},
{
"visible": true,
"text": "Lot of Documents",
"position": 4,
"id": "10788529406"
},
{
"visible": true,
"text": "Bad customer service",
"position": 5,
"id": "10788529407"
}
]
},
"visible": true,
"href": "https://api.surveymonkey.net/v3/surveys/87263608/pages/260492760/questions/1044925207",
"headings": [
{
"heading": "What is the most important issue which we need to address for overall a better service?"
}
],
"position": 2,
"validation": null,
"id": "1044925207",
"forced_ranking": false
}
],
"title": "",
"position": 1,
"id": "260492760",
"question_count": 2
}
],
}
We can use these ids to decipher the answer we get after fetching responses using get response API(Bulk or each respondent).
For eg:,
If my survey has two questions, like
Then after fetching the responses we get a json like this:
{
"total_time": 34,
"href": "https://api.surveymonkey.net/v3/collectors/94630092/responses/5120000552",
"custom_variables": {},
"ip_address": "182.76.20.30",
"id": "5120000552",
"logic_path": {},
"date_modified": "2016-12-01T11:01:11+00:00",
"response_status": "completed",
"custom_value": "LAI100023",
"analyze_url": "http://www.surveymonkey.com/analyze/browse/EvaBWWcU9K1XTH_2FFFBTfFul4ge94MwVWvBk0eAFDJ3c_3D?respondent_id=5120000552",
"pages": [
{
"id": "260492760",
"questions": [
{
"id": "1044924866",
"answers": [
{
"choice_id": "10788526677",
"row_id": "10788526669"
}
]
},
{
"id": "1044925207",
"answers": [
{
"choice_id": "10788529404"
}
]
}
]
}
],
"page_path": [],
"recipient_id": "2743199128",
"collector_id": "94630092",
"date_created": "2016-12-01T11:00:37+00:00",
"survey_id": "87263608",
"collection_mode": "default",
"edit_url": "http://www.surveymonkey.com/r/?sm=SfTljxZSoBFvaRUeGSI6L813qctjfG_2FDCVcqCks7CDc4TcJC_2BNHqmPYD7NNTcvST",
"metadata": {
"contact": {
"first_name": {
"type": "string",
"value": "John"
},
"last_name": {
"type": "string",
"value": "Doe"
},
"email": {
"type": "string",
"value": "neeta#xyz.com"
}
}
}
}
We can map the questions and answers using their IDs in this response with the ids we got from survey details. For open ended text questions, we get direct typed responses.

YQL data posting issue

I'm new to YQL so this is propably (hopefully) an easy question.
I am trying to post into this webpage https://portaluc.puc.cl/uPortal/Login username and password.
I followed this guide to solve the issue:
http://christianheilmann.com/2009/11/16/using-yql-to-read-html-from-a-document-that-requires-post-data/
however, when I post into the webpage I receive this response:
{
"execution-start-time": "101",
"execution-stop-time": "1427",
"execution-time": "1326",
"http-status-code": "502",
"http-status-message": "Tunnel Connection Failed",
"proxy": "DEFAULT",
"content": "https://portaluc.puc.cl/uPortal/Login"
}
],
"cache": [
{
"execution-start-time": "99",
"execution-stop-time": "100",
"execution-time": "1",
"method": "GET",
"type": "MEMCACHED",
"content": "09fb3008bbf8ca09c3fba9693b20efae"
},
{
"execution-start-time": "100",
"execution-stop-time": "100",
"execution-time": "0",
"method": "GET",
"type": "MEMCACHED",
"content": "190.8.76.67"
},
{
"execution-start-time": "102",
"execution-stop-time": "103",
"execution-time": "1",
"method": "GET",
"type": "MEMCACHED",
"content": "https://portaluc.puc.cl/robots.txt"
},
{
"execution-start-time": "1254",
"execution-stop-time": "1254",
"execution-time": "0",
"method": "GET",
"type": "MEMCACHED",
"content": "https://portaluc.puc.cl/robots.txt"
}
],
"redirect": {
"from": "https://portaluc.puc.cl/uPortal/Login",
"status": "302",
"content": "https://portaluc.puc.cl/uPortal/render.userLayoutRootNode.uP"
},
"javascript": {
"execution-time": "1330",
"instructions-used": "4000",
"table-name": "htmlpost"
},
"user-time": "1430",
"service-time": "1407",
"build-version": "37740"
},
"results": {
"postresult": null
}
Thanks in advance for the help

Resources