GitHub REST API: Efficiently Fetch Comment Lists from Mutliple Issues - api

I want to use the GitHub REST API to fetch "a list of comments made in repository X since date Y".
GitHub does not appear to have a specific API method designed to do what I want efficiently.
The repos/comments method appears to return git commit comments, not GitHub issue comments.
The issues/comments method will let me fetch comments made on a single issue.
The best I've been able to come up with is querying for issues (which will include PRs) for a date range, and then making a single API call per issue. This means if there's been activity in 20 issues, I'm making 21 API calls (one for the list of issues and then twenty for each issue to get the comments).
This feels inefficient. Is there a way to get the information I want (all issue comments made on a repository within a date range) using fewer API calls?

Related

Get github API results more than 100

I want to develop github alike issue tracker.
For that i have been working on this below api.
https://api.github.com/repos/facebook/react/issues?per_page=100
But this api results only 100 results per request as per docs.
Is there a way i can get all results of issues and not just 100,i can make multiple request but i don't think it is feasible way of doing it.
Issue object itself contain author,label,assignee so needed all results at once.
Is there any way to do it?
No, there is no way to get all of the results without pagination. GitHub, like almost all major web sites, has a time limit on the amount of time a request can take. If you have a repository with, say, 150 000 issues, then any reasonable operation on all of those issues will take longer than the timeout. Therefore, it doesn't make sense for GitHub to allow you to disable pagination in this way because the request would invariably fail anyway.
Even if you use the GraphQL API, you still get a limited number of results. If you want to fetch all of the issues, you'll need to make multiple requests.

YouTrack REST API returns only subset of all users

Since version 2018.3, YouTrack has published a new API for administrating the system. One example of a new endpoint is /api/admin/users/ which is supposed to return the collection of users in the YouTrack instance, with a wide variety of fields being available compared to the old, deprecated, API.
However, when using it, I've found that it returns only a subset of all users in the instance; in my case, it produces only 42 out of 106 users.
As a workaround, I've used the deprecated API endpoint, /rest/admin/user/ to get all users, and called the new endpoint for each of the 106 results to get the newly available detailed information, but this is rather wasteful in the number of calls required, adds a dependency on a deprecated API, is altogether pretty wonky, and doesn't appear to be the intended workflow.
So the question becomes: How does one use the new API to get all users?
There is a default limit for a result array which is 42.
You can override it by sending /api/admin/users/?$top=<YOUR_LIMIT> , you can also send -1 to get the whole set of users (may cause performance issues).
Additionally, you can use a combination of $top and $skip get parameters to iterate through your users.

Relational Database: Best practice regarding amount of queries per API call

I am working with React Native/Redux and an express/postgresql backend.
I have an api call to create a comment that returns the created comment as well as some of the information concerning the user.
Those are two different api calls.
Now I also need the updated comment count to send to the feed reducer so that the count is still correct when they close the comment tab.
I was wondering if it is still okay to have 3 queries in one API call and maybe more general/meta, if there might be a better solution to this if that isn't the case.
Kind regards
It's perfectly fine to do multiple queries in a single API call. You can do as many as are required to complete a single coherent interaction between the server and client.

How to get reposted tracks from my activities?

Using the Souncloud API, I'd like to retrieve the reposted tracks from my activities. The /me/activities endpoint seems suited for this and I tried the different types provided.
However, I didn't find out how to get that data. Does anyone know?
Replace User Id, limit and offset with what you need:
https://api-v2.soundcloud.com/profile/soundcloud:users:41691970?limit=50&offset=0
You could try the following approach:
Get the users that shared a track via /tracks/{id}/shared-to/users endpoint.
Fetch the tracks postet by this user via /tracks endpoint, as the _user_id_ is contained.
Compare the tracks metadata with the one you originally posted.
I am not into the Soundcloud API, but taking a close look at it seems to make this approach at least as technical possible, though e.g. fetching all tracks won't be a production solution, of course. It's more a hint. Perhaps reposting means something totally different in this context.
And the specified entpoint exists in the general api doc, so I don't know if you would have to extend the java-api-wrapper for using it.

Commission Junction API for Local (Daily) Deals

Has anyone used Commission Junction's Product Catalog Search API for searching/fetching local deals? (BuyWithMe and KGBDeals post their deals to CJ)
There is a Yipit clone out there which uses this API. This clone was unable to categorize deals properly based on location. I was supposed to fix this issue. The problem I saw is: API's response does not contain location/city info. Therefore, deals cannot be categorized based on cities. This basically kills the purpose of local deals.
I am looking for advice from anyone who has done similar work using CJ API. May be I am missing something.
OneBigPlanet has an All-In-One API filled with all affiliate networks and daily deal providers for U.S & Canada
If you are going to use a deal aggregator API for your site/blog, you may want to take a look at this one as well.
SideBuy has recently released its version 1 API which lets the user (like yourself) connect to its comprehensive set of daily deals using several parameters to fully customize the listings. I suggest you check it out and get in touch in SideBuy's site if you need further assistance.
Disclaimer: I work for sidebuy.com.