How to access weather data from all the stations in one country using openweathermap? - openweathermap

I am using Alteryx to extract weather data for a handful of cities and it works great. I'd like to expand this to able to download data for all weather stations in the UK. At the moment I am specifying which cities I want, e.g. London / Manchester.
Is there a way of specifying in the api call to download all stations in 'GB' or 'UK'?
Ideally I'd like to do this in one call rather than listing all locations which will be very laborious

Get a list of stations or cities that you want to retrieve weather data from. I found some good sources from openweather here: http://bulk.openweathermap.org/sample/
Then build a url request using the list of id's above that retrieves specific weather information. Using an id for the weather station in Cairns, id=2172797, the url ends up looking like:
http://api.openweathermap.org/data/2.5/weather?id=2172797&appid=843798874aac0ef138e6f77c72f3af80
Note that this url will return an error because this isn't a real appid. If you replace the appid with your own, this url will give you data for that station.
Putting this process into Alteryx lets you put the list of station id's together with the url and the appid to make many calls into openweather and then process all of the data together. I could not find information from the API on rate limits, so be conscious of how many requests you are posting to the service.
There is an example of this process here: https://www.dropbox.com/s/yoppbx3bw0p4rug/Get%20individual%20stations.yxzp?dl=0
Keep in mind that you have to update the Appid in the text input tool within this sample as well.

Related

Google Storage Transfer service to BigQuery - GEO doesn't give correct data

I have an issue with the GEO and Google Storage Transfer service. I use it to pull Google Ads data in to BigQuery. It's not empty but the numbers don't match. E.g. a query like this
SELECT _DATA_DATE, sum(clicks) FROM project.dataset.GeoStats_XXX where LocationType='LOCATION_OF_PRESENCE' and IsTargetingLocation IN (true, false) group by 1
returns a smaller number than the real one, the one that I get if I just create the same report via Google Ads UI. I've tried different manipulations with the LocationType and IsTargetingLocation filters but nothing seems to work.
I see no errors in Storage Transfer service logs
The CampaignStat returns almost correct data but there is no GEO info there and I need the country breakdown. Not Target Location but GEO (location of presence)
I expect the numbers returned by my query to match the numbers that I see via Google Ads UI

How to get the weatherbox from a wikipedia page using the API?

Most of the larger cities have a table with climate data. I think Wikipedia calls them weatherbox.
Is there a way to retrieve these tables via the API?
For instance, to get the climate section for NYC I do:
https://en.wikipedia.org/w/api.php?action=parse&prop=wikitext&pageid=645042&section=18&format=json
I get the text but not the actual table which is referred to as {{New York City weatherbox}}.
There seems to be another way to retrieve some weatherboxes but this isn't working for many cities.
This one works:
https://en.wikipedia.org/wiki/Template:New_York_City_weatherbox
but this one doesn't:
https://en.wikipedia.org/wiki/Template:Turin_weatherbox

API to retrieve subscribers with statistics from journey in Marketing Cloud (former ExactTarget)

We have following task:
In the Marketing Cloud there are few journeys created by Journey Builder. They all are assigned to different Data Extensions via Event Source.
I'm going to receive all Data Extension rows that participate in specific Journey. Also we need to retrieve basic statistics by participants that shows us actual status of participant (data extension row in journey) like: what is the current place in journey for participant (received first email, received sms in line after first email etc.).
To retrieve all participants I suspect we have to use:
GET /interaction/v1/eventDefinitions/{eventDefinitionId}
where eventDefinitionId is Id from
GET /interaction/v1/interactions/{journeyId}
please correct me if I'm wrong.
The question is if there is some API that allows to retrieve statistic data described below.
Thanks,
Roman

Get geo-locations from cities

I am trying to display a list of closest restaurants of a given city within a radius. In order to do this, I'll have to convert the city to a longitude/latitude.
When the user fills in his/her restaurant information, he/she will fill in the address. Based on that address i need to get a longitude/latitude and save that to the database.
I don't need to point this on a map. I'll be just displaying a list of all closest restaurants within the given radius to the user.
How can I do this with ASP.NET-MVC4?
Also, this project is based on Code First. And for address I have DbGeography as datatype set.
The project is kind of based on this tutorial
Edit
To avoid anyone else telling me this is not possible with ASP.NET on it's own, I am aware of that. an example with Google maps / .NET wrapper would be great.
This query itself is typically done in the database back-end because the program is the consumer of the data not the keeper of the data. You will have a table of restaurants, possibly for many cities, each restaurant having a latitude and longitude. You create a geospatial index on the table, which performs a tesselation for performance; you configure the tesselation parameters. You must determine the latitude/longitude of your restaurant-seeker's location. Your command object would feed that data to a stored procedure, along with the desired radius. The stored procedure would return an enumerable set of rows to your client program.
I found this .NET wrapper which fulfills my need.

Google Places API: Using Multiple Name Parameters in the Places Search

I've been reading the documentation at: http://code.google.com/intl/nl/apis/maps/documentation/places/#PlaceSearches
But How do I modify the Place Search Request (shown below) so that I can limit the results to specific businesses only.
https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AIzaSyAiFpFd85eMtfbvmVNEYuNds5TEF9FjIPI
For example in the above code it hastypes=food&name=harbour as two of the parameters. How can I include just "bakery" and "cafe" (both are supported list types) as the types parameter and then include multiple name parameters as well.
In bigger cities it may come back with 20 or so results, but I want to limit it to a handful of businesses that I have agreements with and just show their names on the map. I don't want Starbucks to come back so I want to restrict it to just the 8-10 businesses that I have the agreements with. Their names will be stored in a database so I can easily retrieve them and pass them into the HTTP URL, but I don't know how to do multiple names and get them all to show up on the map at the same time.
Any links to tutorials that can help or your ideas and suggestions would greatly help!
You can include types "bakery" and "cafe" by modifying your request parameter types=food|bakery|cafe add more types separate by "|" operator
for supported type list refer Link