Retrieving Company Name from Web Search using Ticker - r

I have a list of 3000+ tickers for which I would like to get their respective company names. I couldn't find these names using the Bloomberg database.
I manually checked on Google for few of them and found that the first web page in google search that gives the company's name when I enter the US-based tickers is that of Bloomberg. For example, when I searched for "0000284D US Equity", the first page is https://www.bloomberg.com/profile/company/0000284D:US. For non-US based tickers such as "010520 KS Equity", the first page that shows the company's name could be something else.
I checked posts like this one - Finding company name from a ticker in Bloomberg - but couldn't find the relevant solution.
Is there any R package that can help in fetching the company name from web search using the ticker? Please suggest. Thanks.

I couldn't find a package in R but could find a package in python that can help. We can pass the tickers in a list and then print their long names as below.
pip install yfinance
import yfinance as yfin
x = yfin.Ticker("AAPL")
print(x.info['longName'])

Related

Using package "Microsoft365R" to read incoming attachments

Within 'R' there is a neat new package named Microsoft365R - the only issue with this package I have personally had so far is trying to read in emails and pull off the attachments based on either system date, subject name or both of these factors.
It is possible to pull attachments using the package and to read emails and to dictate i.e. the 4th email etc. but if I was to receive a number of emails, I would want it to pull off this data based on system date and the subject name (as previously mentioned) i.e.:
I get permit data for SW KPI1 and SW KPI2 (named accordingly) on the 1st of the month - then I want the system to run and look for any emails that have SW KPI in the name that were sent on the same system-date and either download them to a set folder or to 'R' directly of which I can then transform and email out.
If anyone is aware of how to do this (either this package or another that is in version-ish), it'd be greatly appreciated.

Scraping availability of the product

My goal is to scrape some data if the product available or not.
At present I am using the following:
=importxml (B2,//*[#id="product-controls"]/div/div1/div1)
Unfortunately, i am receiving an error. Here is the link to the file https://docs.google.com/spreadsheets/d/11OJvxRRIXJolpi2UttmNIOArAdwh1qeZhjqczlVI8oc/edit#gid=1531110146
As an example, I want to get the data from the url https://radiodetal.com.ua/mikroshema-5m0365r-dip8
and Xpath should be from here
got the formula
=importxml (B2,"//div[#class='stock']")

What's the meaning of "ceid" in Google News url

I am recently working on web scraping of Google News and dealing with the URL format. I have same question of this post about the meaning of ceid.
For example the link from the post: https://news.google.com/rss/search?q=studie&hl=de&gl=DE&ceid=DE:de
I know hl = host language, gl = for the search results whose country of origin matches the parameter value, but I can't find what ceid for. If I cut that part of the search link, it is unable to show the result, so obviously it is a must part.
So what's the meaning and the purpose of the "ceid"?
Many thanks.
It might mean the country name and show the results according to the common language of the country.
For example: 'ceid=IN:en' means the country as "India", and hence the result should show up in English.

Extract Google analytics search keyword and impression

I'm trying to extract search engine keywords using "rga" package in R.
I'm using the report:
acquisition > search console > queries
However I can't find the right metric name in the api for the search keywords.
I'm trying to find a dimension for eg: ga:searchkeyword, ga:searchenginekeyword etc.
I want to run the following code:
ga$getData(ids, dimensions="ga:xxxxxx", metrics="ga:impressions",
start.date="2016-04-01", end.date="2017-04-01")
What dimension should I supply in dimensions parameter?
ga:adMatchedQuery just gives you the keywords a user googled before clicking your AdWords-Ad. You will not see the organic Keywords.
You donĀ“t get the organic Keywords from the Search Console with the GA Reporting API.
You can use the package searchConsoleR (https://cran.r-project.org/web/packages/searchConsoleR/searchConsoleR.pdf) using googleAuthR for the authentication part.
The Query looks like this:
keywords <-search_analytics(website_name,
start_date, end_date,
c("query", "page"),
searchType="web")
ga:adMatchedQuery is what you're looking for
https://developers.google.com/analytics/devguides/reporting/core/dimsmets#view=detail&group=adwords&jump=ga_admatchedquery

Google places api not showing results for some places

Hello i am using simple google map places api to get near by atms for users. My client lives around new york and for some strange reason api shows zero results for that place, but works fine near me (pakistan) . I searched for it a little and found out it was google's issue and some other places were also experiencing the same problem. But i never quite found any solution for this.
This is the get call i use
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.7128,74.1059&radius=10000000&keyword=atm&key=MY_KEY
I would really appreciate the help. Thank you :)
Google place nearby search maximum 50,000 meters (31 miles) . if you try enter more than 50,000 it not work proper.
There is another way for find all ATM in a city. google provide Text Search Requests
https://maps.googleapis.com/maps/api/place/textsearch/json?query=atm+in+Reno,NV,89501,USA&key={API_KEY}
query = keyword + in + city Name
for get city name using latitude longitude
http://maps.googleapis.com/maps/api/geocode/json?latlng=39.52963,-119.81380&sensor=true
For more information how to get city name using latitude longitude
https://developers.google.com/maps/documentation/geocoding/start?csw=1#ReverseGeocoding
for more information about how to use Text Search Requests
https://developers.google.com/places/web-service/search
OR (second way)
There is another way for find all ATM in a city.
Open Google Maps .
create 10-12 or more points latitude , longitude value to trigger
request.
Then use a loop to find all places within these points.
If you want more appropriate results, increase first trigger points
for your requests.
- It is just a logic i created in php.
$triggerPoints = array("lat1,long1", "lat2,long2", "lat3,long3",....);
foreeach(triggerPoints as $tP){
$requestUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=$tP&radius=[YOUR_RADIUS_VALUE]&type=[YOUR_TYPE]&name=panera&key=[YOUR_KEY_HERE";
$results = file_get_contents($requestUrl);
//Do what you want with response JSON data
}
SHORT ANSWER: Use logical types with your needs.
In my case i used food types instead of supermarket. In some cases, my local market named A101 wasnt found under supermarkets. To find which keywords is best for you, you can search below url with your location and map_key and find most common keywords under types for each query and use it.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.986527896166244,%2029.24326049097467&rankby=distance&keyword=a101&key=YOUR_MAP_KEY

Resources