Search Soundcloud API with filters - ruby

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.

Related

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

RegionCode in YouTube API v3

I can't seem to find any information on the implications of using/not using regionCode in the YouTube v3 API, for example the search/list resource.
In the specific, if the regionCode is not specified in the call to the API, will all the videos matching the criteria be returned?
If a video is allowed only in certain regions, not specifying the regionCode in the search request, will the API return it? Or only the unrestricted videos will be returned?
Where can I find some clarification on the topic?
If you do not specify the Region Code then the API automatically determines the region based on your location. So, for example, if I queried the API on my laptop in New Zealand, then the region code would be NZ.
The API outputs the region code. In JSON it is under the tag regionCode.
Generally Region Code is not required. You will get a good matching results output without it.
The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. (string)

Is there a way to search for transactions by custom field?

I store specific custom field for each transaction. I'd like to conduct a search by this field. I wouldn't like to retrieve too many transactions (can filter by payment method id, but still) and iterate through them on application side. So, I read a documentation, didn't find an ability to search by custom field (only by predefined). I didn't try it out, but probably it's possibly to do so by following the same pattern like
var stream = gateway.transaction.search(function (search) {
search.myCustomField().is("custom_field_value");
// or search.customFields.myCustomField().is("custom_field_value");
});
Thanks in advance
I work as a developer for Braintree. Searching on custom fields is not supported at this time. You can see all of the searchable transaction attributes listed here.
If you would like to discuss alternatives, I recommend emailing our support team at support#braintreepayments.com to see if there is another method to achieve what you are trying to do.

IBM SBT SDK: How can I limit search results of CommunityService.getPublicCommunities(params)?

When I call communityService.getMyCommunities(params) or communityService.getPublicCommunities(params) or communityService.getSubCommunities(parentCommunity, params) I would expect that filling params with e. g. tags=[mytag,yourtag] the call would only lookup communities having at least one of these tags (or both, however).
But to me it looks like this param ("tags") is simply ignored, and I always receive all communities of the given category (my / public / sub).
In case of having lots of communities of the requested category this massively slows down performance when I only want to retrieve communities with e. g. one certain tag: I receive all data over the net and must filter / lookup the received object list locally.
What am I doing wrong?
Is there something missing in the SDK implementation?
As part of the communities/my api, you cannot do any filtering... you need to use Search APIs.
In order to get a filtered list of communities based on the tags, you need to make a request to the following URL.
https://apps.na.collabserv.com/search/atom/mysearch?scope=personalOnly&scope=communities&query=&constraint={%22type%22%3A%22category%22%2C%22values%22%3A[%22Tag%2Fprb%22]}&page=1&pageSize=10
Yes, it is URL encoded, you can then change prb to match your tag, and you can repeat the constraints for each tag
You can also reference Link to Search API Constraints

How do I restriction a Google Places Search to a specific country?

The documentation says how I can limit searches to a country by using componentRestrictions. However, the documentation apparently only relates
to JavaScript.
I'm doing a regular request from a PHP application, and need to limit a place
search to a country. However, I can't see how I can limit search results to a country using a regular GET request.
I believe you can just add components=country:XX to your request URL :)

Resources