Sponsors API #3818
Replies: 14 comments 40 replies
-
Hi @filiptronicek! I'm one of the developers on the Sponsors team.
This should be answerable by the new query {
user(login:"filiptronicek") {
... on Sponsorable {
sponsors(first: 10) {
totalCount
nodes {
... on User { login }
... on Organization { login }
}
}
}
}
} You can try this in the GraphQL Explorer.
These are in progress, stay tuned! |
Beta Was this translation helpful? Give feedback.
-
This can be answered by the new query {
user(login: "cheshire137") {
sponsoring(first: 10) {
totalCount
nodes {
... on User { login }
... on Organization { login }
}
}
}
} See docs for the Sponsorable interface: https://docs.github.com/en/graphql/reference/interfaces#sponsorable |
Beta Was this translation helpful? Give feedback.
-
Okay, last piece!
The new field query {
user(login:"someoneSponsoringYou") {
... on Sponsorable {
sponsorshipForViewerAsSponsorable {
tier {
name
monthlyPriceInCents
}
}
}
}
} |
Beta Was this translation helpful? Give feedback.
-
@cheshire137 Thanks for providing the examples for how to use. I haven't gone to GraphQL Academy (rather, it is the first time I try this) so wouldn't have come far w/o the examples. When I run this on my own user I can get all sponsors and all data. However when I try with my team mate, I only get the |
Beta Was this translation helpful? Give feedback.
-
@cheshire137 Is there a way to get all sponsors and not just active ones via graphql? Trying to use the API to create a list of all sponsors and I'm not seeing anything in the schema. It seems like the query only returns donors for the current month and not one time donors from previous months. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi @cheshire137, I am new to graphql, but for now, I have still not found a way to solve my problems. Is there any way that I can retrieve how much sponsor money has got in a specific time duration by username? |
Beta Was this translation helpful? Give feedback.
-
Hi @cheshire137 ! Is there a way to know through the GraphQL API whether a sponsorship is private or public ? Same for Thanks a lot for your response |
Beta Was this translation helpful? Give feedback.
-
Hi @cheshire137! Me again lol. I want to ask you is there any possibility through the GraphQL API to know the number of sponsors the user has over a specific time? For instance, how many sponsors does the user has during April 2022? I try a lot but only can get the sponsor total count for current. |
Beta Was this translation helpful? Give feedback.
-
I don’t know! Let me think about it!
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
From: Sarah ***@***.***>
Sent: Friday, July 22, 2022 2:50 PM
To: ***@***.***>
Cc: ***@***.***>
Subject: Re: [github-community/community] Sponsors API (Discussion #3818)
Yes, I am trying to get public sponsorship information for other users
Gotcha. There's no good way in the API right now to get at sponsorship info over time for someone else. I'd want to discuss with the team if that were something we'd want to expose, though. While you could visit someone's GitHub profile daily and see one day "they have sponsors A, B, C" then the next day "today, they have sponsors B, C, and D" to know that they gained sponsor D and lost sponsor A, it changes things somewhat to think of publicizing that detail in a consumable, aggregate way such as via an API that would let you query "who exactly did this maintainer have as a sponsor on this date," or "in what month did so-and-so stop sponsoring maintainer X". 🤔
Can you share what you're wanting to build with this data? Maybe there's something else that would be reasonable to expose in the API that could help.
—
Reply to this email directly, view it on GitHub<https://github.com/orgs/github-community/discussions/3818#discussioncomment-3208754>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKNOOWXXEKLZA4UQJN6CUTDVVL3RZANCNFSM43IJIA2Q>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi @cheshire137 Is there a way to get (or recompute) the total amount you gave as a sponsor ? As Thanks for your answer |
Beta Was this translation helpful? Give feedback.
-
@cheshire137 hiya!! Is there a rest api equivalent for GitHub sponsors? I tried looking around in the docs but couldn't find anything. I'm not too comfortable yet with using GraphQL so I kinda try to avoid it, heh. |
Beta Was this translation helpful? Give feedback.
-
Hi - I'm trying to get the total number of active sponsors on my account
In the explorer - trouble is I'm trying to do it inside a GitHub workflow, which only ever gives me the public count (even when using a PAT linked to my account, which I wasn't expecting). Is there a particular permission to enable this somehow? or, even better, a different query which just lists the same total count the web pages do (without leaking private sponsor details)? |
Beta Was this translation helpful? Give feedback.
-
If anyone still needs it; This query will:
{
viewer {
login
... on Sponsorable {
sponsors(first: 100, orderBy: {field: RELEVANCE, direction: DESC}) {
totalCount
nodes {
__typename
... on User {
login
name
bio
avatarUrl
twitterUsername
sponsorshipForViewerAsSponsorable {
isActive
createdAt
tier {
id
name
isOneTime
monthlyPriceInDollars
}
}
}
... on Organization {
login
name
description
avatarUrl
twitterUsername
sponsorshipForViewerAsSponsorable {
isActive
createdAt
tier {
id
name
isOneTime
monthlyPriceInDollars
}
}
}
}
}
}
sponsoring(first: 100) {
nodes {
__typename
... on User {
login
name
bio
avatarUrl
twitterUsername
sponsorshipForViewerAsSponsor {
isOneTimePayment
isActive
createdAt
tier {
id
isCustomAmount
monthlyPriceInDollars
isOneTime
name
description
}
}
}
... on Organization {
login
name
description
avatarUrl
twitterUsername
sponsorshipForViewerAsSponsor {
isOneTimePayment
isActive
createdAt
tier {
id
isCustomAmount
monthlyPriceInDollars
isOneTime
name
description
}
}
}
}
}
sponsorsListing {
url
fullDescription
activeGoal {
kind
description
percentComplete
targetValue
title
}
tiers(first: 100) {
nodes {
id
name
isOneTime
description
monthlyPriceInDollars
isCustomAmount
}
}
}
}
} |
Beta Was this translation helpful? Give feedback.
-
There are some very limited queries for the sponsor listing and tiers available through the GraphQL API, but there is no way to get info like:
I made a REST API that mimics what I would love to see being implemented officially, so for inspiration, here it is: https://github.com/filiptronicek/gh-sponsors-api
Beta Was this translation helpful? Give feedback.
All reactions