Why does the Zomato API have issues searching by zipcode? - zomato-api

Inside of Zomato's API documentation, you can utilize the q parameter to input practically anything. With the url below, I have been testing this with zipcodes in my area and it works like a charm.
However, when I venture out and search zipcodes from different states, it finds no results. Now the weird thing is, if I go on Zomato.com and start trying to find restaurants in their website within those different states and return back to my api call, it starts to work with those zipcodes and no longer with zipcodes from my area! What's the deal? Is there like a cookies issue or something. Any advice would be greatly appreciated!
API CALL
https://developers.zomato.com/api/v2.1/search?q= + zipcode + &apikey=[API-KEY]

I found a workaround solution that should help anyone else who runs into this issue. I extracted the lat/lon coordinates from the Google Maps API based on the zip code typed in, and then I ran those lat/lon coordinates through the Zomato API. It's one extra step, but it definitely prevents the Zomato API from having geographic restrictions.

Related

Why I got ZERO_RESULTS for valid addresses in Sweden?

I send this request https://maps.googleapis.com/maps/api/geocode/json?components=country:SE|locality:Huddinge|postal_code:14158&address=Sm%C3%A5brukets+Backe+30%2C+14158+Huddinge but I got zero result.
If I removed "postal_code:14158" it will work but It won't return the right postal code.
I got the same result for many valid addresses.
The Google Geocoding API is designed to help people create maps. Google doesn't do address verification or validation.
Geocoding is the process of converting addresses (like a street address) into geographic coordinates (like latitude and longitude), which you can use to place markers on a map, or position the map. (Google Geocoding API Getting Started)
In your case, it is best to simplify your search terms (drop the postal code, since that seems to work). You will still get fairly accurate results for placing markers on maps.
Also, you could report the information problem to Google Maps. They are responsive: they might update the service so the search returns something valid for your address search term.
If you need exact addresses or you need the postal code in all cases, try an address validation service, such as SmartyStreets. Here is a demo.
Full disclosure: I worked for SmartyStreets.

Cycling through URLs to download csv files

I have a list of URLs which will access a webservice. The webservice downloads .csv files. I want to be able to cycle through them using a date field which is in a specific format in the url itself, thereby downloading the data day-by-day. The access seems fairly slow as even a manual url entry can take a couple of minutes to complete, and I suspect the issue is at the webservice' end.
The URL is in the format:
http://web.service.com/ws/XYZ/data/?key=mysecretkeyf&field1=X&start=YYYY-MM-DD 00:00&end= YYYY-MM-DD 00:00&field=Y&format=csv
So the way I envision it (and I am keen to take advice) is using a variable for the start year, month and day fields cycling onto the next URL as the previous .csv is downloaded, with the code ending when the current date is accessed.
Any ideas most welcome.
The coding is really straightforward which makes me wonder if you are looking to code this yourself or asking if there is a service out there that would help do this. If you are coding, I'd choose a language that works well for you. #Vivek mentioned Python which is what I would choose as well.
If you do not want to go the coding approach, you could check out DownThemAll. I have used this utility for batch downloading where you have to increment numbers in parts of the URL. Check it out, it may be a good non-programming solution: DownThemAll

Retrieving data extension used to filter e-mail send

I'm new to ExactTarget, and I'm having some hard time to do something that should be simple.
We direct our e-mails using a list of All Subscribers, and filter then using data extensions. When I go on the tracking page of a particular e-mail, there it is in the Summary, all the info and the Data Extensions, on the format:
name (number) sent (Using All Subscribers) (number sent)
The thing is, when I do a tracking extract I don't get this information. I tried to extract everything that was possible, and couldn't get this information. All I get is, for each sendID (for each subscriber in fact), the ListID, which will always be the same (the one for All Subscribers). I want to know which segment we used.
Tried to deep dive on the SOAP API, with no luck, again all I can retrieve is the List, never the data extension.
This must be retrievable, once it is on the Tracking Summary. So my question is how do I retrieve is.
I considered programming a simple robot to scrape for this info, but there must be a better way.
Thanks
Guess nobody cares much, but in case someone faces the same problem, I've got a final answer for support, the information is not retrievable (except through the tracking summary, which must be accessed one by one) through API or UI
But a custom report can be asked for. Still waiting to see if it's free of charge (should be, right? As it's something that should be available in first place)

How to access facebook insight datas for consecutive months?

I'm new to Facebook app development I hope I can get an answer here.
Is that possible to retrieve Facebook insight data for consecutive months?
I tried end_time=2010-01-01 to since=2010-01-31 and period=month but I got
The specified date range cannot exceed 3024000 seconds!!
How will I get like 2010-02-01 to 2010-02-28 and 2010-03-01 to 2010-03-31?
I have tried and used lots of examples but I couldn't succeed: How can I solve this problem?
The thing that has worked for me is very similar to what you are doing, with the difference being that I use the UNIX timestamp for SINCE and UNTIL.
Example:
https://graph.facebook.com/212686148747689/insights/
page_impressions_by_city_unique/week/?
access_token=QWERTYUI&since=1315699200&until=1320796800
(That's all supposed to be on one line, but it's easier to read it this way, at least for me.)
With this approach, you want to be careful and make sure that the difference between SINCE and UNTIL is not bigger that 90 days. Otherwise, you'll get an error, like so:
(#604) The specified date range cannot exceed 7776000 seconds
Finally, if you don't have a way of generating the UNIX timestamp automatically, go to a web site like:
http://www.epochconverter.com/
If anyone else has some better insights, please share. I hope this helps.

Looking for Ideas: How would you start to write a geo-coder?

Because the open source geo-coders cannot begin to compare to Google's or even Yahoo's, I would like to start a project to create a good open source geo-coder. Just to clarify, a geo-coder takes some text (usually with some constraints) and returns one or more lat/lon pairs.
I realize that this is a difficult and garguntuan task, so I am wondering how you might get started. What would you read? What algorithms would you familiarize yourself with? What code would you review?
And also, assuming you were going to develop this very agilely, what would you want the first prototype to be able to do?
EDIT: Let's set aside the data question for now. I am going to use OpenStreetMap data, along with a database of waypoints that I have. I would later plan to include other data sets as well, and I realize the geo-coder would be inherently limited by the quality of the original data.
The first (and probably blocking) problem would be: where do you get your data from? (unless you are willing to pay thousands of dollars for proprietary sets).
You could build a geocoding-api on top of OpenStreetMap (they publish their data in dumps on a regular basis) I guess, but that one was still very incomplete last time I checked.
Algorithms are easy. Good mapping data, however, is expensive. Very expensive.
Google drove their cars all over the world, collecting this data among other things.
From a .NET point of view these articles might be interesting for you:
Writing Your Own GPS Applications: Part I
Writing Your Own GPS Applications: Part 2
Writing GIS and Mapping Software for .NET
I've only glanced at the articles but they've been on CodeProject's 'Most Popular' list for a long time.
And maybe this CodePlex project which the author of the articles above made available.
I would start at the absolute beginning by figuring out how you're going to get the data that matches a street address with a geocode. Either Google had people going around with GPS units, OR they got the information from some existing source. That existing source may have been... (all guesses)
The Postal Service
Some existing maps(printed)
A bunch of enthusiastic users that were early adopters of GPS technology who ere more than willing to enter in street addresses and GPS coordinates
Some government entity (or entities)
Their own satellites
etc
I guess what I'm getting at is the information was either imported from somewhere or was input by someone via some interface. As my starting point I would look at how to get that information. In an open source situation, you may be able to get a bunch of enthusiastic people to enter information.
So for my first prototype, boring as it would be, I would create a form for entering information.
Then you need to know the math for figuring out the closest distance (as the crow flies). From there, try to figure out how to include roads. (My guess is you would have to have data point for each and every curve, where you hold the geocode location of the curve, and the angle of the road on a north/south and east/west vector. You'd probably need to take incline into account, too to get accurate road measurements.)
That's just where I'd start.
But in all honesty, I wouldn't even start on this. Other programmers have done it already, I'm more interested in what hasn't already been done.
get my free raw data from somewhere like http://ipinfodb.com/ip_database.php
load it into a database, denormalizing for fast lookups
design my API
build it out as a RESTful web service
return results in varying formats: JSON, XML, CSV, raw text
The first prototype should accept a ZIP code and return lat/lon in raw text.