定價頁 | 點此進入 |
免費方式 | N/A |
定價方式 | 訂閱、 定制 |
采購渠道 | 官網 |
API適用國家/地區 | 美國 |
支持語言 | N/A |
Open Collective是什么公司
更多Open Collective是一家致力于推動透明、開放和社區驅動的財務管理平臺。它允許個人和組織創建集體,以便于籌集資金、管理預算和分配資源,同時確保整個過程的透明度和可追溯性。通過這個平臺,任何人都可以為項目或活動貢獻資金,同時監督資金的使用情況。Open Collective鼓勵社區參與和協作,支持開源項目、非營利組織和其他需要資金支持的事業。
Open Collective的API接口(產品與功能)
Open Collective 是一個平臺,它通過創建圍繞共享事業的社區,幫助團體透明地籌集資金和管理開支。Open Collective API 是公開的,允許開發者在 Open Collective 平臺上構建應用程序。
要開始使用 Open Collective API,首先需要獲取一個 API 密鑰。你可以通過在 Open Collective 網站上創建賬戶來獲取 API 密鑰。
所有 API 端點的基礎 URL 是 https://api.opencollective.com/
。所有 API 請求都需要使用你的 API 密鑰進行認證。
要對請求進行認證,請將 Authorization
頭設置為 Bearer [API Key]
,其中 [API Key]
是你的 API 密鑰。
以下是一些使用 JavaScript 的示例 API 請求:
async function getAllCollectives() {
const url = "https://api.opencollective.com/graphql/v2";
const query = `{
allCollectives {
nodes {
id
slug
name
currency
balance
}
}
}`;
const options = {
method: "POST",
headers: {
"Authorization": `Bearer ${api_key}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ query })
}
const response = await fetch(url, options);
const data = await response.json();
return data.data.allCollectives.nodes;
}
async function createDonation(collectiveSlug, amount, interval = "one-time") {
const url = `https://api.opencollective.com/${collectiveSlug}/donations`;
const options = {
method: "POST",
headers: {
"Authorization": `Bearer ${api_key}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
donation: {
amount,
interval
}
})
}
const response = await fetch(url, options);
const data = await response.json();
return data;
}
async function getAllExpenses(collectiveSlug) {
const url = `https://api.opencollective.com/${collectiveSlug}/expenses`;
const options = {
headers: {
"Authorization": `Bearer ${api_key}`
}
}
const response = await fetch(url, options);
const data = await response.json();
return data;
}
在這篇博客文章中,我們介紹了一些使用 JavaScript 的 Open Collective API 的基本示例。這里涵蓋的示例應該足以讓你開始在 Open Collective 平臺上構建應用程序。
Open Collective API的價格(API免費方式與收費標準)
在選擇API服務商時,綜合評估以下維度,選擇最適合自己需求的API服務商,確保技術兼容性和成本效益。