ESPN API, results of College Football teams not showing all teams - espn

A question for the ESPN API team...
I'm using the ESPN API, and when I use the Teams API to pull a list of College Football teams:
I don't get a full list of all NCAA Football Teams
I can't tell what the reasoning of the teams that ARE listed is
(i.e. 1st result is id:2, 2nd result is id:5)
Is there a reason only some Teams show up? And for the teams that DO show up, what is the rhyme or reason to them being the ones that have been selected to show up?
Thanks for the help! I can add additional info or screenshots if needed at all-

If you set the limit to -1, you get all of the teams.

The teams API uses pagination based on the resultLimit, resultOffset and resultCount nodes in the API response. You can use the offset and limit GET parameters to get a larger, smaller result set as well as use them to make multiple requests in order to get all the teams in multiple requests.
For example: try setting limit to something larger than the default of 50.

Related

Youtube V3 API playlistitems itesm are not sorted by publishedAt

Youtube V3 Api playlistitems method suppose to return the playlist items (video) ordered by publishedAt.(latest first), but the items returned are not ordered.
https://www.googleapis.com/youtube/v3/playlistItems?part=id,snippet&playlistId=PLAYLIST_ID&key=YOUR_API_KEY&maxResults=50
Can be tried in the API explorer (Execute without OAuth) as well.
https://developers.google.com/youtube/v3/docs/playlistItems/list
It was working before, but i noticed this issue few days back so am writing here. is anyone else facing the same.
Did youtube changed the return order to some other metrics? What is going wrong?
Did the YouTube API changed the return order to some other metrics?
No there never was a return order.
If you check the documentation for Playlist.items there is nothing there stating a guarantee of the order items will be returned in. Why the items may have appear to be in one order one day there is no guarantee they will be in the same order the next day.
Nor is there a parameter for you to specificity order. Most of the google apis assume that the developer is able to order the returned items themselves.

YouTube V3 api returns considerably different LIKEs and Comments results from numbers on the Web

YouTube v3 api returns significantly different LIKEs count from what is on the web version of YouTube.
Compare these:
https://monosnap.com/file/EdtDNTTGDK06zoCZ7IXkMdzn6WuyOo
https://monosnap.com/file/CcJOiKl9CBMyncHQSrPv3lkLOuqeDD
To replicate:
https://www.googleapis.com/youtube/v3/videos?id=jWnhFM1Ttwg&key={api_key}&maxResults=50&part=statistics (https://console.developers.google.com/apis/credentials - use your Youtube V3 key)
Any ideas?
Many thanks!
Since I don't have any documentation (from the YouTube Data API v3) that backs me up for what I going to say, I'll drop some thoughts about why the API returns different values in the "likeCount" section comparing to the YouTube actual video (saw in the main website):
I think that the differences in the results returned by the API and the results shown in the website are due to:
YouTube has its own calculations for set the values in the website, the API results and in the YouTube Analytics1.
It would be possible that those additional "likes" retrieved in the API aren't exposed to the calculations made by YouTube.
1 Extracted from this answer in the Google Support webpage:
The number of likes/dislikes in YouTube Analytics may be different than what you see on the watch page under the video. This
is a known issue and our team is working to fix this. In the meantime,
please refer to the counts on the watch page under the video for the most accurate count.
And
In rare instances, you might see more likes/dislikes than views since these metrics are adjusted by different verification
systems.
For the specific videoId you posted in your question, I did check at 2019-01-25 and the results were:
likeCount "by the API": 1341
likeCount "in the YouTube website": 851
Check again at 2019-01-28 the numbers did changed:
likeCount "by the API": 1367
likeCount "in the YouTube website": 877
You can try here the API request for get these results - (results for current day).
If you make a substract from the likeCount values gotten above, you'll get 26.
Maybe it is futile try make any mathematical operation for set the "correct" value shown in the YouTube website (using the likeCount result from the YouTube Data API), but if anyone want give it a try, I encourage you to share your answer.

Mailchimp Custom Automation Suggestions?

Not sure if this is even possible - but we are looking for a way to trigger mailchimp newsletters based on a custom field value in a Wordpress website.
Basically we will have a field value that holds "the number of miles" a person has walked based on the data they enter. We will be calculating the "total miles".....when they reach 100 miles for example we will need an email to trigger from Mailchimp....then 200 miles will trigger a 2nd email and so on....
Does anyone know if this can even be done with Mailchimp? If not is there a better approach to handling this?
THANK YOU!
If you are familiar with Python, I'd recommend using a Jupyter notebook for this to cut down on development work. You could set it to run at regular intervals checking the status of each user (running either on your computer or a server), then updating the merge tag of the status in mailchimp. You can have automations that are triggered when the merge tag of distance is a specific value, say 100 they get the 100 email, 200 they get the 200 email. (You could also do it so when a user hits a certain milestone their merge tag is updated in MailChimp but from my experience that's a little more work.)
Net net there are a few ways to achieve your goal but I think using a Python notebook using pandas to manipulate the data and the mailchimp3 mailchimp API client would be the lightest lift.
TIP: Mailchimp currently has a bug where merge tags information is not always accurately represented in the UI. So for example if via the API you added 500 people with the Distance merge value of 200, and checked that via the UI how many people had a value of 200 for Distance you would likely see an inaccurate number displayed for the count in the UI. If you export the list, you will see the correct number that is reflected in your API update. To be clear, in some cases UI does not display the accurate number for users with that merge tag or value, but if you export the list with that merge tag/value via the UI it should match what you pushed to the API. This is currently an open ticket.

Yammer API - how to get full list of likes using messages endpoint?

I've noticed that the messages.json endpoint doesn't seem to return all the data needed to show the likes per message.
Specifically, two things seem to be happening:
List of likers only has info on 3 users.
The avatar images for the likers is not always available when looking up through the "references" array.
We're using the JS SDK for our integration.
Thanks
https://api.yammer.com/api/v1/users/liked_message/:Message_id.json should return user properties of LIKERS, a count of all LIKERS should give you the total LIKES per message.
In practice, you'd need to call the messages endpoint, get the message id, then pass it into users/liked_message/:Message_id.json programatically.
See here for further details - https://developer.yammer.com/docs/usersliked_messagemessage_idjson

Exhaustive Search on Google Places

I'm trying to use Google Places API for a business locator app, but am having trouble creating an exhaustive database of business.
1.The API call only returns 20 results back.
2.The "type" restriction (e.g. type=restaurant) does not pick up all businesses by type in a given zip. I could use "keyword" but not all restaurants have restaurant in their name, and not all spas have "spa" in their name.
3. Each call produces the same set of results from day to day, and with only 20 returns per call, how am I to get a more exhaustive database of businesses?
I can try to get around the above three constraints by looping through a very well degraded search of businesses: say by zip code, some list of keywords, category type. But I still won't get close to picking up the 50 million or so businesses in google places.
In fact, even when I make a call for restaurants and bars in my own neighborhood, I don't pick up popular places down the block from me.
How is the API usable for an app that locates places then?
Any suggestions on how to create a more exhaustive search?
Thanks,
Nad
I'm not able to answer your question regarding Google Places API.
But for your requirements ('business locator app', 'I don't pick up popular places down the block from me') I suggest you try Yelp Search API:
Yelp's API program enables you to access trusted Yelp information in real time, such as business listing info, overall business ratings and review counts, deals and recent review excerpts.
Yelp is a popular review website with a capable API and you may test the quality of database and the devoted user base they have at Yelp homepage.
Note:
They keep some data for themselves and do not return everything in response.
The (free) dev account has a limit of 100 calls per 24 hours.
I know I'm late but maybe it helps someone these days.
By default, each Nearby Search or Text Search returns up to 20
establishment results per query; however, each search can return as
many as 60 results, split across three pages.
You need to use the field nextPageToken that you will receive on the first search to get the next page.
https://developers.google.com/places/web-service/search
An issue in stack overflow says:
There is no way to get more than 60 results in Places API. Some people
tried to file a feature request in Google issue tracker, but Google
rejected it with the following comment Unfortunately Places API is not
in a position to return more than 60 results. Besides technical
reasons (latency, among others) returning more than 60 results would
make the API be more like a database or general-purpose search engine.
We'd rather improve search quality so that users don't need to go so
far down a long list of results.
google places api more than 60 results
I faced the same difficulties that you did and decided to use the Yelp API instead. It is free, very complete and returns up to 1000 results. You should however check the terms of service before doing anything. It does not provide the website of the business (only the Yelp website link).
https://www.yelp.com/developers/documentation/v3/business_search
Other options I investigated at that time:
Foursquare ventures. (It was very expensive, and only returned up to around 100 results)
Here places API
Factual Places (I don't think this one is an API)
Sygic Travel API (Specific for touristical spots)
Planet.osm (OpenStreetMap)

Resources