Overview

Code.gov functions as the central repository and policy framework for open source software within the U.S. federal government. Launched in 2016, its primary objective is to facilitate the identification, sharing, and reuse of custom-developed source code across federal agencies and with the public. The platform provides a searchable catalog that aggregates open source projects contributed by various government entities, ranging from small utilities to larger applications. This catalog supports developers in discovering existing solutions, potentially reducing redundant development efforts and fostering collaboration.

Beyond the software catalog, Code.gov offers comprehensive policy guidance for federal agencies regarding their participation in the open source ecosystem. This guidance, detailed in the Code.gov policy documents, outlines requirements and recommendations for agencies on how to release code as open source, manage contributions, and adhere to licensing best practices. The initiative aims to enhance transparency, improve the quality of government software through community feedback, and optimize taxpayer investments by promoting code reuse.

For developers, Code.gov is a resource for identifying government-developed tools and libraries that can be integrated into their projects or studied for best practices. The platform's API provides programmatic access to its catalog data, allowing for custom applications that can filter, search, and display government open source projects. Technical buyers and program managers can use Code.gov to assess the landscape of government-contributed open source, inform procurement decisions, and encourage internal code sharing initiatives within their organizations. The emphasis on open source software aligns with broader trends in software development that prioritize collaboration and public access, as highlighted by organizations like the Mozilla Developer Network's definition of open source principles.

The platform's utility extends to various stakeholders. For federal employees, it serves as a discovery tool to find code that has already been developed and vetted by other agencies, potentially saving development time and resources. For the public, it offers transparency into how government software is built and provides opportunities for external developers to contribute to federal projects, improving the software's quality and security. Code.gov supports the U.S. government's Open Government Initiative by making public sector code more accessible.

Key features

  • Searchable Open Source Catalog: A centralized index of U.S. federal government open source projects, allowing users to search by agency, language, license, and keywords to find relevant software.
  • Policy Guidance for Agencies: Provides documentation and best practices for federal agencies on how to manage, release, and contribute to open source software, ensuring compliance and promoting effective code sharing.
  • API Access to Catalog Data: Offers a read-only API for programmatic access to the entire catalog of projects, enabling developers to build custom applications or integrate data into existing systems.
  • Agency Dashboards: Features dedicated pages for participating federal agencies, showcasing their open source contributions and adherence to Code.gov policies.
  • Contribution Guidelines: Offers resources and frameworks for external developers to understand how they can contribute to government open source projects.
  • Licensing Information: Each project entry includes details on its open source license, ensuring clarity on usage and modification rights.

Pricing

Code.gov is a government-funded initiative, and as such, all its services and data access are provided at no cost.

Service Cost (as of 2026-05-28) Notes
Access to Open Source Catalog Free Search and browse all listed projects.
API Access Free Programmatic access to catalog data via the Code.gov API.
Policy Guidance Free Access to all policy documents and best practices for agencies.

Common integrations

As a platform primarily focused on discovery and policy, Code.gov's direct integrations are primarily through its API. Developers integrate the Code.gov API to:

  • Custom Dashboards: Build internal agency dashboards to track and visualize open source contributions and compliance.
  • Developer Portals: Incorporate government open source project listings into broader developer portals or resource hubs.
  • Research Tools: Automate data collection for academic or policy research on government technology trends.
  • Internal Search Engines: Enhance internal search capabilities within large organizations to include relevant government open source projects.

Alternatives

  • GitHub Explore: A broad platform for discovering open source projects, including many government-affiliated ones, but without a specific U.S. federal government focus.
  • GitLab Explore: Similar to GitHub, offering a vast array of public and private repositories, with options to explore trending and featured projects.
  • SourceForge: An older, established platform for open source project hosting and discovery, though less focused on government-specific initiatives.
  • Public Code Repositories on Agency Sites: Some individual federal agencies maintain their own public code repositories (e.g., NASA's open source projects), which may contain projects not yet indexed by Code.gov.

Getting started

To begin exploring projects or integrating with the Code.gov API, you can start by making a simple HTTP request to retrieve a list of projects. The Code.gov API is read-only and does not require authentication for public data access. The base URL for the API is https://code.gov/api/v3.

Here's an example using curl to fetch the first few projects:

curl -X GET "https://code.gov/api/v3/projects?page=1&size=5" \
  -H "accept: application/json"

This command requests the first five projects from the Code.gov catalog. The API response will be in JSON format, containing an array of project objects, each with details such as the project name, description, agency, and links to its repository. For more detailed query parameters and response structures, refer to the Code.gov API v3 documentation.

Developers can parse this JSON response in their preferred programming language to extract project information. For instance, in Python, you might use the requests library:

import requests
import json

url = "https://code.gov/api/v3/projects?page=1&size=5"
headers = {"accept": "application/json"}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    data = response.json()
    print(json.dumps(data, indent=2))
else:
    print(f"Error: {response.status_code}")
    print(response.text)

This Python script performs a similar request and prints the JSON response in a human-readable format. You can then iterate through data['projects'] to access individual project details. The Code.gov API supports various query parameters for filtering by agency, language, license, and more, allowing for specific project discovery tailored to development needs. Understanding these parameters is key to effectively utilizing the Code.gov API for project discovery.