google json api search results limit, not 100 search queries per day - json

The Google Custom Search API requires the use of an API key, I have get from the Google APIs console. The API provides 100 search queries per day for free. I want to more,so I have signed up for billing in the console and succeed.I can set the requests/day,defalut 1000 requests/day.But the total results are still 100,I show 10 in one page,so I can get 10 pages.
Billing solve the querys per day,but not the total results.The document does not explain clearly.What should i do to solve the results problem.Does XML API have the same problem? Must I Replace the JSON API by XML API?

another year passed... Limits are the same =((
Google forces us to use multiple accounts to get complete search results.
Use a query per day/week/month.
Or you can sort huge result array by publish date. And when '100-items' limit is reached you should execute new request with excluding first items by applying "the lowest(or the highest) possible value" condition on publish date.
btw, using webbrowser you could set 100 results per page. So total count of result items is 1000 per query. Web crawling would be helpful=))))
be happy!

Related

Google Fit Running data

I am using Google API Client for fitness to retrieve user fitness data using the PHP Client library.
My usecase: To get users Total run time for the day, and also distance.
I am using the following code (sample code with key steps):
$service = new Google_Service_Fitness($google_client);
$dataSets = $service->users_dataset;
..
$aggBy->setDataTypeName("com.google.activity.segment");
..
$aggregates = $dataSets->aggregate('me',$aggReq);
I am using com.google.activity.segment as datatypename:
I get a response with run type with data
Activity type: 8
runtime : value in msec
no of segment: 2
Now i want to get the total distance travelled during running session,
From above response i can make out that user had 2 separate running activity, then how i can get the combined distance done by the particular activity?
Also how i can retrieve details about these in 2 running segment in details?
As said i am using PHP Client API.

How to search for terms in title and content using Wikipedia's API

On Wikipedia search box you can search for a term, e.g. 'lens', in article's title AND content. Using the search API however works only with titles. What request do I need to be able to extend the search on article content too?
The search API should perform "a full text search". The reason you're receiving only 10 results is most likely because you've not set the srlimit parameter which defaults to 10 and you're not continuing the query. You can set srlimit to max to receive 50 or 500 results (depends on the access level of your account) and in order to get the rest of the results one needs to continue the query using the parameters given in the last result.

EWS Managed API - Filter items by body

I have 1100 appointments in the outlook calendar, 330 of them has category = "concrete_category" and body = "concrete_body".
I am trying to filter calendar appointments by category and body substring using the following AQS:
"category:{concrete_category} AND body:\"{concrete_body}\""
I expect to receive 330 items, but Outlook returns me only 250 appointments and cache the response. So if I change appointment body or category, outlook will return the same appointments as for the previous query but with updated categories and body that doesn't match the aqs filter. And I have to refilter them on the client side.
How to prevent query caching and exceed the limit of 250 appointments? I don't have this problem when I don't use filter by body.
You can reset the Cache by using the ResetCache Attribute of the QueryString element https://msdn.microsoft.com/en-us/library/office/exchangewebservices.querystringtype.resetcache(v=exchg.150).aspx. Unfortunately the EWS Managed API doesn't expose this so you would need to use SOAP or proxy code EWS API Search Filter does not return all information or modify the source of the EWS Managed API from the github repo.
The 250 limit is normal but you should be able just to page through to get the next 250 items.

Unable to retrieve unlimited number of record via API

We are struggling to mine all time records for this year via API.
We have tried to include the :dont_limit_result GET variable and set it to 1, however it did not help us.
The version that we use is ACTIVE COLLAB 5.11.0, the URL we are hitting: projects?dont_limit_result=1&page=$page
Please give me some advise on how to proceed.
Most of API responses are paginated, and pagination can't be turned off using a GET switch. Instead, you should check following headers:
X-Angie-PaginationCurrentPage - indicates current page
X-Angie-PaginationItemsPerPage - indicates number of items per page
X-Angie-PaginationTotalItems - indicates number of items in the entire data set.
and walk through pages until you reach the end of data set.
Another option is to give project's filter a try. Here's an example request that will return all projects:
curl -H "X-Angie-AuthApiToken: YOUR-API-TOKEN" "http://your.activecollab.com/api/v1/reports/run?type=ProjectsFilter"
This one will return all active projects:
curl -H "X-Angie-AuthApiToken: YOUR-API-TOKEN" "http://your.activecollab.com/api/v1/reports/run?type=ProjectsFilter&completed_on_filter=is_not_set"
I'm using the php API wrapper 3.0 - how do i get the headers back to know there are more pages and then what is the correct form of the query to get further pages?
For example my basic query is:
$timeRecords = $client->get('projects/22/time-records')->getJson();
to get time records - but this only returns 100 and there are more!
Thanks,
P

Valid to return different json-response depending on list or retrieve?

I am currently designing a Rest API and is a little stuck on performance matters for 2 of the use cases in the system:
List all campaigns (api/campaigns) - needs to return campaign data needed for listing and paging campaigns. Maybe return up to 1000 records and would take ages to retreive and return detailed data. The needed data can be returned in a single DB call.
Retrieve campaign item (api/campaigns/id) - need to return all data about the campaign and may take up to a second to run. Multiple DB calls is needed to get all campaign data for a single campaign.
My question is: Is it valid to return different json-responses to those 2 calls (if well documented) even if it regards the same resource? I am thinking that the list response is a sub set of the retreive-response. The reason for this is to make to save DB calls and bandwitdh + parsing.
Thanks in advance!
I think it's both fine and expected for /campaigns and /campaigns/{id} to return different information. I would suggest using query parameters to limit the amount of information you need to return. For instance, only return a URI to each player unless you see a ?expand=players query parameter, in which case you return detailed player information.