Google Ads API: want to find the cost data through API - google-ads-api

The Image shows the overview of ads related to an ad account, I need to find the cost marked in the pic through API
I tried with
ad_group metrics.average_cost, metrics.cost,
account_budget.amount_served_micros,
account_budget.total_adjustments_micros,
account_budget.proposed_spending_limit_micros,
account_budget_proposal.account_budget,
account_budget_proposal.approved_spending_limit_micros, account_budget_proposal.proposed_spending_limit_micros,
campaign.campaign_budget,
campaign_budget.amount_micros,
campaign_budget.total_amount_micros
most of the values I got in these are zero or not relevant to the cost in the overview (marked in pic) . Can someone help me find the cost value( which is marked in the image) in the ads overview screen through GoogleAds API.

Your query isn't a complete query. We don't know what resource you're querying. For example, why are you requesting budgets?
If you share your code, we might be able to help you more. But you need to query the campaign costs from the campaign resource and aggregate yourself.
https://developers.google.com/google-ads/api/fields/v12/campaign?hl=en

Related

How to fetch the ETF's data into a Google Spreadsheet?

Following this post, where I had listed some of the interesting ETF1s I had found on some of the relevant forums, I received some valuable criticism. Now I want to use a Google spreadsheet to get the updated information of those ETFs in one place, and maybe use it for personal portfolio management. What I need:
preferably fetching data using the ISIN2 code, as the tickers/symbols are not really reliable and consistent between different databases and markets
The information I need are:
the current value of the ETF
the 1-year, 3-year, and 5-year performances/returns
current fund size
TER: Total Expense Ratio
TD: Tracking Differences
1-year volatility
For example, consider the "iShares Core MSCI World" ETF which is listed as "IWDA" on "Euronext Amsterdam" and an ISIN code of "IE00B4L5Y983". What I have read so far:
From this page and this post, I have used the GOOGLEFINANCE function to fetch the current price and some other information from Google Finance. However, I don't know how to fetch/calculate the 1/3/5-year performances, the fund size, TER, and the TD. Moreover, according to this comment, Google Finance, like many other Google products seem to be dying. So it would be great to have a more sustainable solution.
This post, suggests some syntax using index and IMPORTXML functions to fetch from etf.com. And this comment uses the same functions to fetch from nasdaq.com. But I couldn't make either to work, mainly because I don't know what symbol should I use.
This and this comments suggest the DGET and IMPORTDATA functions, to fetch data from api.iextrading.com, but I could not make it to work either.
This post and many other posts on the bogleheads.org forum, use all variants of syntax using the importHTML function to import and pars HTML tables from many different websites. There are many reliable websites that if I learn how to use this function I could fetch data from.
I would appreciate it if you could help me know how I can get the above information. Thanks for your kind support in advance.
P.S.1. From here, I was able to use the commands:
=INDEX(SPLIT(INDEX(importHTML(CONCATENATE("http://etfs.morningstar.com/quote-banner?&t=", C5), "table", 1),1,11), " "), 1, 3)
and
=INDEX(SPLIT(INDEX(importHTML(CONCATENATE("http://etfs.morningstar.com/quote-banner?&t=", C5), "table", 1),1,13), " "), 1, 2)
to pull Total fund size and TER consequently. However, they do not deliver data fro most of the ETFs and also I'm not sure how reliable this website is.
Footnotes:
1: Exchange-Traded Fund
2: International Securities Identification Number

Yahoo Finance API get list of all mutual funds and ETFs tickers

I'm looking for a way to get list of all mutual funds and ETFs tickers from Yahoo Finance. I've found few solutions like for example:
https://github.com/Benny-/Yahoo-ticker-symbol-downloader
or
http://investexcel.net/all-yahoo-finance-stock-tickers/
But unfortunantely after checking dozens of random tickers most of them didn't belong to mutual funds category. Having list of this tickers seems useful as long I could find a way to check ticker's category.
On Yahoo Finance website using search box, popup show ticker's category. How to replicate this functionality programmatically or using for example YQL?
EDIT:
After following Daniel's advise I've successfully filtered tickers and
updated them on my GitHub:
https://github.com/MichaelDz6/Yahoo_Finance_ETFs_Web_Scraper
It's possible to tell wether ticker is mutual fund or ETF but it's hard to distinct between mutual fund and ETF.
As an example let's take mututal fund with ticker TIBIX. From what I know only mutual funds and ETFs have category "Fund Family" in their profile tab. So you need YQL that checks whether ticker contains HTML span containing "Fund Family" inside.
Raw YQL query
select * from htmlstring where url='https://finance.yahoo.com/quote/TIBIX/profile?p=TIBIX' and xpath='//span/*[contains(.,"Fund Family")]//text()'
Endpoint for the query
https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20htmlstring%20where%20url%3D'https%3A%2F%2Ffinance.yahoo.com%2Fquote%2FTIBIX%2Fprofile%3Fp%3DTIBIX'%20and%20xpath%3D'%2F%2Fspan%2F*%5Bcontains(.%2C%22Fund%20Family%22)%5D%2F%2Ftext()'&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
If you ticker is mutual fund or ETF, query should return such response:
{"query":{"count":1,"created":"2017-09-25T07:07:10Z","lang":"en-US","results":{"result":"Fund Family"}}}
Either way result will be empty.

How to get Yahoo Finance Key Statistics such as return on equity

I would like to get key statistics data for a given symbol in Yahoo! Finance.
I found a few ways to get statistics data using Yahoo Finance API.
For example, to get Appleā€™s name (n), ask (a), bid (b), market cap(j1),
http://finance.yahoo.com/d/quotes.csv?s=AAPL&f=nabj1
(e.g. http://www.jarloo.com/yahoo_finance/)
But I would like to extract more information such as return on equity and enterprise value.
How can I do this?
I cannot even fetch these values from web scraping either.
Key statistics can be accessed by calling the following API-Call:
https://query1.finance.yahoo.com/v10/finance/quoteSummary/AAPL?modules=defaultKeyStatistics
This includes enterprise value and book value.
I have not found a way to get return on equity directly from Yahoo Finance but it could be calculated from other values found in this answer.
Edit:
Return on equity can be found in the financial data:
https://query1.finance.yahoo.com/v10/finance/quoteSummary/AAPL?modules=financialData

How to get stock of finance yahoo API

I want to get data of some selected stock of finance yahoo API. I am listing these API here .
Chart
http://finance.yahoo.com/echarts?s=AAPL+Interactive#
Key statistics
http://finance.yahoo.com/q/ks?s=AAPL+Key+Statistics
Competitors
http://finance.yahoo.com/q/co?s=AAPL+Competitors
Analyst Opinion
http://finance.yahoo.com/q/ao?s=AAPL+Analyst+Opinion
Analyst Estimates
http://finance.yahoo.com/q/ae?s=AAPL+Analyst+Estimates
Major Holders
http://finance.yahoo.com/q/mh?s=AAPL+Major+Holders
Income Statement (annual and Quarterly)
http://finance.yahoo.com/q/is?s=AAPL
Balance Sheet (annual and Quarterly)
http://finance.yahoo.com/q/bs?s=AAPL+Balance+Sheet&annual
Cash Flow (annual and Quarterly)
http://finance.yahoo.com/q/cf?s=AAPL+Cash+Flow&annual
Is there any api which give me exact solution for this.Even it is paid.Please Provide me correct and sufficient information also thanks in advance.
You can get most of what you're looking for using the yahoo_fin package in Python. Its documentation is here: http://theautomatic.net/yahoo_fin-documentation/.
Here's some examples:
Pulling analyst info (e.g. https://finance.yahoo.com/quote/AAPL/analysts?p=AAPL):
from yahoo_fin.stock_info import *
get_analysts_info("AAPL")
Income statment:
get_income_statement("AAPL")
Cash flow statment:
get_cash_flow("AAPL")
Balance sheet:
get_balance_sheet("AAPL")
Key statistics (e.g. https://finance.yahoo.com/quote/AAPL/key-statistics?p=AAPL):
get_stats("AAPL")
Major holders (e.g. https://finance.yahoo.com/quote/AAPL/holders?p=AAPL):
get_holders("AAPL")
You just need to replace "AAPL" with whatever ticker you want data for.

Collecting follower/friend Ids of large number of users - Twitter4j

I'm working on a research project which analyses closure patterns in social networks.
Part of my requirement is to collect followers and following IDs of thousands of users under scrutiny.
I have a problem with rate limit exceeding 350 requests/hour.
With just 4-5 requests my limit is exceeding - ie, when the number of followers I collected exceeds the 350 mark.
ie, if I have 7 members each having 50 followers, then when I collect the follower details of just 7 members, my rate exceeds.(7*50 = 350).
I found a related question in stackoverflow here - What is the most effective way to get a list of followers using Twitter4j?
The resolution mentioned there was to use lookupUsers(long[] ids) method which will return a list of User objects... But I find no way in the API to find the screen names of friends/followers of a particular "User" object. Am I missing something here.. Is there a way to collect friends/followers of thousands of users effectively?
(Right now, I'm using standard code - Oauth authentication(to achieve 350 request/hour) followed by a call to twitter.getFollowersIDs)
It's fairly straightforward to do this with a limited number of API calls.
It can be done with two API calls.
Let's say you want to get all my followers
https://api.twitter.com/1/followers/ids.json?screen_name=edent
That will return up to 5,000 user IDs.
You do not need 5,000 calls to look them up!
You simply post those IDs to users/lookup
You will then get back the full profile of all the users following me - including screen name.

Resources