Count number of results, which search is better? Google custom search API or Bing API? - bing

I want a count for the number of results obtained when i post a query. Which search API is better for this? I found google custom search API very unreliable about the count that it returns and it allows only 100 free queries per day, on the other hand Bing API allows 5000 queries per month and returns the same count as shown on the bing.com. But if you put the same queries to google.com and bing.com then the resulting cout they give differs a lot and google's is more reliable in that aspect. I am confused, can anybody help?

Related

Does SharePoint Search API throws any threshold limit in any case?

I have gone through following question
SharePoint REST API call with more than 500 rows
We want to use Search API with REST API or JSOM. We have large lists in SharePoint. The data can be 100000 or more items in a single list. There are multiple large lists. In some scenarios search API which will search across all lists and in some scenarios it will also search in a single lists.
So like REST API does it throw threshold error for more than 5000 matched items or does SharePoint Search REST API throws any threshold limit in any case?
As Mike pointed out, I'm not aware of any limitations in terms of API's for search in SharePoint. You will have to make a lot of sub requests to retrieve all the items if you need to do so (but generally speaking, it'd probably be better to have a more complex query, retrieving less items and giving more work to the search engine). More details on how you can paginate (REST) here.
Keep in mind that your search service application needs to be properly designed to accept all the items otherwise it might stop indexing new items. (if you're on prem. or doing hybrid)

Possible to specify date_preset with insights edge in Facebook Ads API?

For the Marketing API, I know that I'm able to make one call to retrieve all of the adsets from a certain account along with their insights, but am I able to specify the date_preset for the insights edge in that same call?
For example, the following gives me lifetime insights stats:
/v2.4/{accountID}/adcampaigns?fields=insights
To be clear - I know this is possible to retrieve by making separate calls for each adset id (where I know I can specify the date_preset); instead, I'd like to do this via the call where I get a long list of the ad sets plus their insights details in one go.
Yes this is possible using query expansion, however you probably should not do it in this anyway.
Using query expansion results in multiple requests being executed in one HTTP call, in this case one to get all the adcampaigns, and then N requests where N is the number of adcampaigns returned. This will in turn affect your rate limiting.
The most efficient way to request all insights for all adcampaigns (ad sets) is instead to request them at the account level, specifying aggregation level:
/v2.4/act_{ADACCOUNT_ID}/insights?date_preset=last_7_days&level=campaign
This requires just 1 request, or the number of requests to retrieve the total number of pages.
If you really want to achieve this with query expansion, you can do the following for example:
/v2.4/act_{ADACCOUNT_ID}/adcampaigns?fields=insights.date_preset(last_30_days).time_increment(all_days)
You can see the parameters to insights that would normally be query parameters of the form param_name=param_value are now in the form of param_name(param_value).
To specify the date_preset , here is the correct format . Its important to use insights as edge to get the date_preset filtering .
/v2.10/act_{ADACCOUNT_ID}/insights?fields=impressions,clicks,ctr,unique_clicks,unique_ctr,spend,cpc&date_preset=last_3d
The above one is tested with latest Graph Api version(2.10) as of now . FOr more info related to the date_preset values refer to there api docs .
https://developers.facebook.com/docs/marketing-api/insights/parameters

Facebook API - math operator

Is it possibile to filter results from Graph API Search by number range? When I type:
fields=name,likes&q=mobile&type=page
I get number of fans of each page.
I can also get the number of events attendes:
attending.limit(1).summary(true)
Can I use math operators for this statistics? Ex. to filter pages, that has over 1000 fans? Something like: Fields:likes>100 (it’s my idea, not a code).
Unfortunately, there are no filters to get specific entries only. You would have to implement paging and do the filtering on your own. Which would be nearly impossible for very large results.

Get total number of items via QuickBooks API

The QuickBooks Online api supports paging and sorting results with special query parameters. Paging requires two parameters: PageNumber and ResultsPerPage. However, there doesn't seem to be any way of figuring out how many pages are available at a given number of results per page, or how many objects there are. The response only includes the current page and how many things are on it.
Is it possible to get either a total count of items for a given search? Or at least a total number of pages?
In QBO there is no direct api to get the total count or the total number of pages.
You need to use paging only for this use case.
To use paging use the findAll method(with page no and chunk size attributes) of the corresponding entity.
ex - Ref doc for Customer(QBO)
http://developer-static.intuit.com/SDKDocs/QBV2Doc/ipp-java-devkit-2.0.10-SNAPSHOT-javadoc/
(QBOEmployeeService).
Ref example -https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0200_ipp_java_devkit/0800_crud_examples

Pagination in the event search API

I am performing a rest call to facebooks search API using type=event
e.x.
search?fields=id,name,picture,owner,description,start_time,end_time,location,venue,updated_time,ticket_uri&q=concert&type=event
I have looked through the documentation and still have a few questions about specific pagination behavior of the event search API.
If I used a broad search term like "ma" and keep querying the pagination ['next'] URL would I cycle through all facebook events starting with "ma"? Does the pagination array give any indication when there are no more results to return?.
Do these searches include past events? If so is it possible to eliminate past events using the "since" parameter?
What is the maximum for the limit parameter?
Update:
As far as I can tell the number of pages you can get from a facebook search is limited to 500. This includes pages that can be accessed via pagination. In other words a query with limit >=500 will not return a pagination url, likewise a query with limit 250 will only return one pages worth of pagination.
You will "next page" until the count of results comes less then the limit
I'm not sure if that is possible using a simple Graph Request. Maybe using FQL
I don't know exactly. But i used a 2000 limit one day. And it worked.
Other doubts you can get answers testing your resquests with this tool
https://developers.facebook.com/tools/explorer/
I am also doing the same thing like you. I am collecting public post using graph search api.
When there are no results available or you reach max limit pagination section will not be there in response. So you can always check for paging is there in json response or not something like this.
NextResult = DeserJsonFBResponce.paging != null ? DeserJsonFBResponce.paging.next : string.Empty;
I am not so sure about this with events but for public post i am able to eliminate post using science and until parameters.
Maximum for the limit parameter is 2000 per get request.