Google Shopping atom feed and actual google shopping website data - google-shopping-api

i am using google shopping api to get the sellers data as an atom feed but sometimes the google atom feed have less shops that the actual number of shops that i can see on the google shopping website when using the same search keyword or ean code.
what might cause this, are the there options for shops to make their product data hidden in the atom feed?!

EDIT: As paging is not the issue, the OP is correct in stating that there is a way for merchants to exclude their results from API requests. On the Product Feed Specification, there is an excluded_destination parameter which can be configured for a particular destination.
You are likely running into a paging situation. Google (and other) APIs will usually not return all of the results for a particular query in the response (think if you were to query something that returned 10,000,000 results - that could be a lot for your program to handle as well as burdensome for the provider to provide).
In order to circumvent this, many APIs provide a parameter that lets you go to the 'next page' of results. The Shopping API provides just such a parameter (nextLink), which you can append to your query to get the page of results following the current one
From the documentation:
{
"kind": "shopping#products",
"etag": value,
"id": "tag:google.com,2010:shopping/products",
"selfLink": value,
"nextLink": value,
"previousLink": value,
"totalItems": value,
"startIndex": value,
"itemsPerPage": value,
"currentItemCount": value,
content module,
...
content module,
"items": [
product resource
]
}
Where nextLink = Link to the next page of products, omitted if there is no next page

Related

File.list only returning Id and name

I am doing a file.list in the google drive api
GET https://www.googleapis.com/drive/v3/files?access_token=XXXX
This is working fine but its only returning four fields for each of the files in the list
"kind": "drive#file",
"id": "1x8-vD-XiXEEA5Spf3qp8x2wltablGF22Lpwup8VtxNY",
"name": "Experts Activity Dump go/ExpertsActivities",
"mimeType": "application/vnd.google-apps.spreadsheet"
The documentation states that it should be returning a full file resource for each file but its not.
The only thing i have been able to do is to do a file.get on each of the files to get additional information.
This was an old issue that appears to have been fixed now.
GET https://www.googleapis.com/drive/v3/files?fields=*&access_token=XXXX
by sending fields=* you can now see a full file.resorce response for each of the files in the list. It is no longer necessary to do a file.get for each file.
That being said its probably a good idea to limit the fields to those you actually need
This is the intended behaviour of the API. For reference, you may see here the explanation next to the "fields" parameter:
The paths of the fields you want included in the response. If not specified, the response includes a default set of fields specific to this method. For development you can use the special value * to return all fields, but you'll achieve greater performance by only selecting the fields you need. For more information see the partial responses documentation.
For this api, the default fields are indeed kind, id, name and mimeType.
It is recommended that you limit the fields (using the aforementioned parameter) to the ones you need, as it will yield a considerable performance difference.

Find Place requests Returns Only One Result

I'm using the Google Places API endpoint "findplacefromtext" and tried a search similar to the example.
https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=mongolian%20grill&inputtype=textquery&fields=photos,formatted_address,name,opening_hours,rating&locationbias=circle:2000#47.6918452,-122.2226413&key=YOUR_API_KEY
However, when you use this it only ever returns one result. There is a cafe near me that's called "Cream" but when you pass that as the "input" parameter it returns shops that have a category of "Ice Cream". I thought it should only search the name of the business.... If I can't find the place by name does it search the category type as a fall back? When I execute the same search in Google Maps it returns the same data but I get multiple results and I can see the place I am trying to retrieve 3rd on the search result list.
Is it possible to make it return more than one result? The documentation doesn't mention anything about this.
I believe what you need is the Text Search request. The Find Place request is meant for exact addresses.
The Google Places API Text Search Service is a web service that
returns information about a set of places based on a string — for
example "pizza in New York" or "shoe stores near Ottawa" or "123 Main
Street". The service responds with a list of places matching the text
string and any location bias that has been set.
The service is especially useful for making ambiguous address queries
in an automated system, and non-address components of the string may
match businesses as well as addresses. Examples of ambiguous address
queries are incomplete addresses, poorly formatted addresses, or a
request that includes non-address components such as business names.
Taken from https://developers.google.com/maps/documentation/places/web-service/search#TextSearchRequests

Search Soundcloud API with filters

According to the Soundcloud documentation (https://developers.soundcloud.com/docs/api/guide#search,
"Some resource types, such as sounds, can be filtered by fields like
license, duration or tag_list."
Is there some list in existence of what attributes can be filtered like this? For example, say I want to find artists with the name of 'billy' that have between 100 and 1000 followers. I would expect I could do (using the Ruby client)
client.get('/users', q:'billy', followers_count: {from:1000, to:10000})
But those followers_count limits are not respected in the results. Why not?
The page you link says
For a complete list of search fields and filters, please see the API Reference for the resource type you'd like to search.

Google Global Address List for Domain limited to 250 results [rehash]

Reposting due to lack of answers
I'm trying to query Google Global Address List for a specific domain, being led by this answer here (Specifically the answer by Jay Lee).
It's all well and good and works perfectly in Google's OAuth Playground, however it seems to be limited to 250 users. Given that this feature seems completely undocumented, and that I can't tell by looking at their github repo (specifically this file), does anyone know how to query for the next 250 users or how to set the number of results?
Thank you!
My last answer was converted into a comment, but I now have a complete answer to this question.
EDIT: I repeatedly mention JSON but you don't need to parse this in JSON to get the syncToken. Google will provide you the syncToken regardless.
The Google GAL API seems to operate in a similar manner to the Google Calendar or YouTube API's "nextPageToken" parameter, which allows you to query the next page of results as long as you have a token.
The Google GAL uses the "syncToken" parameter as a replacement. Much like the other Google API's, if you append this syncToken to the end of your URL, you will get the next page of results. Note that I was unable to get the startIndex parameter to work (which allows you to begin at a specific item in the JSON), so if you are trying to get a specific result through the query you will most likely have to parse the entire JSON file. Inside the parsed JSON, there should be a key called "gal$syncToken." You can find it in the json right before the "entry" key/array which is where all of the global domain contacts are listed.
Here is an example of what it would look like:
"gal$syncToken": {
"$t": "0_1001_17011_AAN3FFNH2AEJ3SFBKZDRS36AHRXHND47YACXLGFJF5QBXCSQLUK57EX3LC765CU5IWG6ZXWHPS5WKHSDFJ26LRI5FRIVIQ3Z532PWKG3ZG45JW3RVCDZMWK5LLLHZSCBTJH5U6Q4LZRG4PKWQE42AOIPC4VJCZQIP5MBJHNUBZZJNLKISKETTQ6DNTRAPTI"
},
Your syncToken will look different. To get the next page of results, Google actually provides a link that already has the syncToken pre-appended:
{
"rel": "next",
"type": "application/atom+xml",
"href": "https://www.google.com/m8/feeds/gal/example.com/full?sync-token=0_1001_17011_AAN3FFNH2AEJ3SFBKZDRS36AYRXHND47YACXLGFJF5QBXCSQLUK57EX3LC765CU5IWG6ZXWHPS5WKHSDFJ26LRI5FRIVIQ3Z562PWKG3ZG45JW3RVCDZMWK5LLLH6SCBTJH5U6Q4LZRG4PKWQE42AOIPC4VJCZQIP5MBJHNUBZZJNLKBSKETTQ6DNTRAPTI"
},
However, this will only give you the next 250 results. If you want more on each page, you can append the max-results parameter to this and have Google spit it back out in JSON format.
https://www.google.com/m8/feeds/gal/example.com/full?sync-token=INSERT_SYNCTOKEN_HERE&alt=json&max-results=10000
Hope this helped anyone seeing this. The Google GAL seems to be largely undocumented for the most part and I was unable to find an answer to this question anywhere else on the internet. If anyone from Google can confirm that this is the best method for accomplishing this that would be great!

OpenRasta - Providing Filter, Sorting and Paging for List Resources

We are creating a REST API using OpenRasta and apart from regular GET, POST, PUT and DELETE on all resources, we are also providing GET on resources with plural names. So a consumer of the API can GET, POST, PUT and DELETE on User and also perform GET on Users which will return List<Users>. Now we want the clients to be able to filter and sort it by it's properties and allow to support paging for showing data in paged tabular formats.
Although, I looked at WCF Data Services Toolkit home page and looks like it can be useful but after looking at blog posts and Getting Started page, I couldn't understand how I can use it to solve my problem in OpenRasta.
Or is there anything else simpler that I can do?
OR doesn't support stuff like OData for that functionality, mainly because it leads to very unrestful systems.
If /users is "the list of users", then it is a different resource than /users/1 (the first page of users) or /users/byName/1 (the first page of users ordered by name).
You can of course implement all this easily by registering a URI that has query parameters, as those are optional
.AtUri("/users?page={page}&filter={filter}
And your handler can look like
public List<User> Get(int page = 0, string filter = null) { ... }

Resources