Why can I not limit my Scopus API search by country? - url

I am trying to limit my searches on Scopus to articles published in the U.S. only. I keep putting in this facet, but every time I put in the limitation, the search throws an error. For example, I know for sure that there are multiple articles in this pull that have the first author affiliation as the U.S., but when I limit the search to just include U.S. affiliations, it tells me there are no results.
Here is the url I'm using for the search:
https://api.elsevier.com/content/search/scopus?facets=country(include=United%20States)&field=dc:identifier,authkeywords,affiliation-country&query=issn(19384122)&count=200&date=2018&httpAccept=application/json&apiKey=KEY&insttoken=TOKEN
What am I doing wrong?

Putting quotes around "United States" gave me 40 results
https://api.elsevier.com/content/search/scopus?facets=country(include="United States")&field=dc:identifier,authkeywords,affiliation-country&query=issn(19384122)&count=200&date=2018&httpAccept=application/json&apiKey=KEY&insttoken=TOKEN

Related

Tweepy: Find all tweets in a specific language

I'd like to extract all tweets in the Arabic language in all countries.
I modified the code in this tutorial.
This is my search query.
api.search(q="*", count=tweetsPerQry, lang ['ar'],tweet_mode='extended'). I expect to find a very large number of tweets, but I only collected about 7000 tweets.
I checked the content of some of them and I noticed that they are posted in my country even I did not specify the location/Country (Can anyone explain why this happen??).
I tried to know the reason for finding a limited number of tweets, so I modified the query by replacing the lang parameter by geocode to find tweets in a city. I fetched more than 65,000 Arabic tweets. After that, I used the lang parameter with the geocode and I found a very limited number of tweets.
Can anyone help me to know why I'm not able to get a large number of tweets when I used lang parameter?
The free twitter API's are good for small projects, but keep in mind that they don't display all of the tweets. Twitter has paid API's that are much more powerful, though what you are trying to achieve should be possible. I ran the query attached bellow, it seemed to work I was able to find a considerable amount of tweets. This method also seemed to work for #ebt_dev too I think it was just the structure of your request was set out like the stream listener version not the cursor search.
# Search Query change the X of .items(X) to the amount of tweets you are looking for
for tweet in tweepy.Cursor(api.search, q='*',tweet_mode='extended', lang='de').items(9999999):
# Defining Tweets Creators Name
tweettext = str( tweet.full_text.lower().encode('ascii',errors='ignore')) #encoding to get rid of characters that may not be able to be displayed
# Defining Tweets Id
tweetid = tweet.id
# printing the text of the tweet
print('\ntweet text: '+str(tweettext))
# printing the id of the tweet
print('tweet id: '+str(tweetid))

How can I get Only Health related Data from Google API?

I want to get only results that are related to health and for that I used below api.
https://maps.googleapis.com/maps/api/place/search/json?location=23.0225,72.5714&radius=500&types=hospital&sensor=false&key="API_KEY"
Above API gives me the results related to Health but I don't want to pass location lat long Parameter.
Actually I want to search it with "input" Param like below.
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Ahmedabad&types=hospital&radius=500&key="API_KEY"
But above give me error like below
{
"predictions" : [],
"status" : "INVALID_REQUEST"
}
How can I get this type of results?
Thanks in Advance.
The places autocomplete request from your question has several issues.
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Ahmedabad&types=hospital&radius=500&key=API_KEY
If you remove the location parameter, you should remove the radius parameter as well. It doesn't make sense without location.
hospital is not allowed value in types filter of autocomplete. If you check the documentation, you will see that the only possible values are:
geocode
address
establishment
(regions)
(cities)
Place autocomplete might return only 5 suggestions. I think you are looking for something different.
Also, be aware that radar search mentioned in the comments is now deprecated and will stop working in June 2018.
https://maps-apis.googleblog.com/2017/06/announcing-deprecation-of-place-add.html
I would suggest having a look at Places API text search. Your query with Places API text search might be
https://maps.googleapis.com/maps/api/place/textsearch/json?query=Ahmedabad&type=hospital&key=YOUR_API_KEY
The text search can return up to 60 results divided into pages of 20 results. For your particular example, I got the following output
Hope this helps!

Differing search results between Twilio web search and Ruby API helper

I'm getting different results between the searches I run on on twilio.com and the searches I run through the Ruby gem helper.
Here's a sample search:
Here's a search with the same zip code in a Rails console, returning an empty array:
> #twilio_client.account.available_phone_numbers.get('US').local.list({in_postal_code: "19428"})
=> []
These searches were conducted less than a minute apart.
Is this an issue with the REST API, the Ruby helper gem, or my search query?
Ricky from Twilio here.
The code you're using is correct to retrieve phone numbers restricted to a postal code and I can see why you would expect it to match up with the search on Twilio.com. In our search we're actually doing the lookup a bit differently. You can create an experience similar to ours by using a different set of filters to retrieve phone numbers.
#numbers = #client.available_phone_numbers.get('US').local.list(
near_lat_long: '40.6928,-73.9903',
distance: '5'
)
Since phone numbers within a postal code can be sparse we can ensure results by expanding our search to be near the location a user searches for.

YQL documentation for the google.news search and the "geo" key

Someone know some documentation of Yql Google News Search? I am trying understand the "geo" key values for the search.
This link show a example for the search.
Thanks and sorry for my bad english.
Cleber.
For details of the usage of the different keys on the YQL google.news table, see the source API's documentation.
In this case that can be found in the Google News Search API - JSON Developer's Guide, and the geo key is described as:
This optional argument tells the News Search system to scope search results to a particular location. With this argument present, the query argument (q) becomes optional. You must supply either a city, state, province, country, or zip code as in geo=Santa%20Barbara or geo=British%20Columbia or geo=Peru or geo=93108.
It goes on to say:
When using the geo property, please note the following:
Make sure the location you supply exists within the scope of your chosen news edition. For example, if you specify geo=Quebec for the Canadian edition of Google news, you probably won't get good results.
You can't combine geo with the topic property.
Some editions of News Search don't support the geo parameter. To test if geo works with a specific edition,
Go to that edition's landing page (for example, news.google.ca)
Click Add a Section.
In the Add a Local Section box on the right side of the page, enter a search query relevant to your desired location (for example, Quebec). You should now see a Local Results pane on the edition homepage.
If the Local Results pane is populated with results, you can use the geo parameter for that region.

fetch tweets through location

Can I fetch all the tweets from users of a particular location filtered by a particular keyword?
For example, I want to look up all the tweets made during a day in a particular location with a keyword "XYZ". Can this be done?
Yep, you can use the form on http://search.twitter.com/advanced to construct an advanced query.
Also check out http://dev.twitter.com/doc/get/search for more API info.
So, for example, finding tweets containing "very nice" from users located within 100 miles from Los Angeles would be written as:
near:"Los Angeles" within:100mi "very nice"
Your search URL would then look like:
http://search.twitter.com/search?q=near%3A%22Los+Angeles%22+within%3A100mi+%22very+nice%22
You can also get these results in JSON or ATOM format but you'll need to include the geocode parameter that the search page generates. Easiest way to find this is to copy the param from the "Feed for this query" link on the top-right of the page.
So, results in JSON format:
http://search.twitter.com/search.json?geocode=34.052187%2C-118.243425%2C25.0km&q=near%3A%22Los+Angeles%22+within%3A100mi+%22very+nice%22
Results in ATOM format:
http://search.twitter.com/search.atom?geocode=34.052187%2C-118.243425%2C25.0km&q=near%3A%22Los+Angeles%22+within%3A100mi+%22very+nice%22
Specifying a date range is also possible; use the advanced search form to help you construct what you need.

Resources