Skip to main content

Get started with OSO API

The OSO API serves queries on metrics and metadata about open source projects. It is a GraphQL API backed by the OSO data pipeline.

Let's make your first query in under five minutes.

Generate an API key

First, go to www.opensource.observer and create a new account.

If you already have an account, log in. Then create a new personal API key:

  1. Go to Account settings
  2. In the "API Keys" section, click "+ New"
  3. Give your key a label - this is just for you, usually to describe a key's purpose.
  4. You should see your brand new key. Immediately save this value, as you'll never see it again after refreshing the page.
  5. Click "Create" to save the key.

generate API key

Prepare your query

You can navigate to our public GraphQL explorer to explore the schema and execute test queries.

GraphQL explorer

For example, this query will fetch the first 10 projects in oss-directory.

query GetProjects {
oso_projectsV1(limit: 10) {
description
displayName
projectId
projectName
projectNamespace
projectSource
}
}

Issue your first API request

All API requests are sent to the following URL:

https://www.opensource.observer/api/v1/graphql

In order to authenticate with the API service, you have to use the Authorization HTTP header and Bearer authentication on all HTTP requests

curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DEVELOPER_API_KEY" \
-d '{"query":"query GetProjects { oso_projectsV1(limit: 10) { description displayName projectId projectName projectNamespace projectSource } }"}' \
https://www.opensource.observer/api/v1/graphql

Next steps

Congratulations! You've made your first API request. Now try one of our tutorials.