For Agents
Search and retrieve metadata about U.S. federal government open source code repositories, agencies, languages, and publishing status from Code.gov.
Get started with Code.gov API in minutes using your preferred integration method.
# Add to your MCP client config (Claude Desktop, Cursor, Windsurf)
{
"jentic": {
"url": "https://api.jentic.com/mcp",
"auth": "oauth"
}
}
# Then ask your agent:
"search U.S. federal open source repositories"
# → Jentic returns the GET /events tool with parameter schema, agent executes.What an agent can do with Code.gov API API.
Search the federal open source repository inventory by keyword, agency, or language
Retrieve a single repository record with contact, license, labor hours, and reuse metadata
List federal agencies that publish a code.json under the Federal Source Code Policy
Read agency-level publishing status, including issues encountered and last fetch time
GET STARTED
Use for: I want to search U.S. federal open source repositories by topic, Find repositories published by a specific agency such as NASA or USDA, List the programming languages most used across federal open source code, Get the publishing status for a federal agency's code.json
Not supported: Does not host repository contents, modify federal code records, or expose private agency data — use for discovery and metadata over the public federal open source inventory only.
The Code.gov API provides access to the U.S. Federal Government's open source software inventory created under the Federal Source Code Policy. It exposes endpoints for searching repositories, listing publishing agencies, retrieving programming languages used across federal code, and checking the publishing status of each agency's code.json. Researchers, civic technologists, journalists, and procurement teams use it to inventory federally-funded code, find reuse candidates, and track which agencies are meeting their publishing obligations.
Pull popular terms used across the federal repository corpus
List programming languages with the count of repositories using each
Check the deployed Code.gov API version, git commit, and repository for traceability
Patterns agents use Code.gov API API for, with concrete tasks.
★ Federal Open Source Reuse Discovery
Procurement teams and contractors building software for the federal government use Code.gov to find existing repositories that can be reused before commissioning new work, satisfying the reuse-first requirement of the Federal Source Code Policy. The /repos endpoint accepts keyword search and the /repos/{repoId} endpoint returns the repository metadata, license, and contact needed to evaluate fit.
Search /repos for the keyword 'machine learning' and return the top 10 repository names, agencies, and licenses.
Compliance and Transparency Reporting
Civic technologists and oversight researchers use the agency and status endpoints to track which federal agencies are publishing code under the Federal Source Code Policy and which have stale or failing code.json files. /agencies and /status/{agencyName}/issues expose the data needed to build public scorecards of compliance.
List all agencies, then for each call /status/{agencyName}/issues and report agencies with non-zero issue counts.
Federal Code Inventory Research
Researchers studying federal software practices use Code.gov to assemble corpus-level statistics. /languages returns repository counts per programming language and /terms returns popular tags, supporting research into how federal teams build software, the open source licenses they prefer, and the breadth of federally-funded code in the public domain.
Pull /languages and /terms and produce a summary of the top 10 languages and top 20 terms across the federal corpus.
AI Agent Federal Code Search
AI agents helping public-sector teams find existing federal code use Code.gov through Jentic. The agent searches Jentic for 'search Code.gov repositories', loads the operation, and runs keyword searches against /repos. Because the public Code.gov API is unauthenticated, Jentic forwards requests directly while still providing schema-driven discovery and load-once-call-many ergonomics for the agent.
Search Jentic for 'list Code.gov repositories', load the operation, and search for 'natural language processing' across all federal agencies.
12 endpoints — the code.
METHOD
PATH
DESCRIPTION
/repos
Search federal open source repositories
/repos/{repoId}
Retrieve a single repository by ID
/agencies
List federal agencies
/agencies/{agency_acronym}
Retrieve metadata for a single agency
/languages
List languages with repository counts
/status/{agencyName}/issues
Get issues for an agency's publishing status
/version
Get the deployed API version
/repos
Search federal open source repositories
/repos/{repoId}
Retrieve a single repository by ID
/agencies
List federal agencies
/agencies/{agency_acronym}
Retrieve metadata for a single agency
/languages
List languages with repository counts
Three things that make agents converge on Jentic-routed access.
Credential isolation
The Code.gov API is unauthenticated in the spec, so no credentials need to be vaulted. If the consumer wants to attach an api.data.gov key for higher rate limits, Jentic stores the key in its vault and injects it as a query parameter or header at execution time.
Intent-based discovery
Agents search Jentic by intent (e.g. 'search federal open source repositories') and Jentic returns the matching Code.gov operation with its input schema, so the agent does not have to read the spec.
Time to first call
Direct Code.gov integration: a few hours to wire HTTP calls and pagination. Through Jentic: under 30 minutes — search, load schema, execute.
Alternatives and complements available in the Jentic catalogue.
GitHub REST API
Hosts many of the federal repositories indexed by Code.gov
Use GitHub when the agent needs to read or modify repository contents; use Code.gov when the agent needs federally-scoped discovery.
Code.gov API (main)
Same Code.gov API exposed under the 'main' slug for compatibility
Either entry resolves to the same upstream service; the choice is a routing convenience for the agent runtime.
Data.gov API
Federal open data catalogue covering datasets beyond source code
Use Data.gov when the agent needs federal datasets; use Code.gov when the agent needs federal source code.
Specific to using Code.gov API API through Jentic.
What authentication does the Code.gov API use?
The OpenAPI spec declares no security schemes — the Code.gov API is publicly accessible without an authenticated bearer or API key in the spec definition. In practice api.data.gov fronts the service and may apply a default rate-limit tier; through Jentic the request is forwarded with no credentials attached.
Can I search repositories by agency with the Code.gov API?
Yes. Use GET /repos with agency filter parameters to scope results to a specific federal agency, or call GET /agencies/{agency_acronym} first to confirm the acronym. The /repos response includes the publishing agency on each record so client-side filtering is also possible.
What are the rate limits for the Code.gov API?
The OpenAPI spec does not declare a rate limit. The Code.gov service is fronted by api.data.gov which applies the default unauthenticated tier; for higher throughput register an api.data.gov key and pass it in the api_key query parameter or X-Api-Key header per api.data.gov documentation.
How do I list federal agencies through Jentic?
Search Jentic for 'list Code.gov agencies', load the GET /agencies operation, and execute it. Install with pip install jentic and use the standard async search, load, and execute flow.
Can I check whether an agency's code.json is up to date?
Yes. GET /status/{agencyName}/issues returns the issues encountered while fetching the agency's code.json and GET /status/{agencyName}/fetched returns the last fetch timestamp. Use both to surface which agencies are publishing successfully and which are failing or stale.
How is this different from the GitHub or GitLab API?
GitHub and GitLab serve repositories from those platforms; Code.gov aggregates only U.S. federal government repositories that agencies publish under the Federal Source Code Policy, regardless of where the source is hosted. Use Code.gov for federal-scope discovery and the platform APIs for repository-level operations.
/status/{agencyName}/issues
Get issues for an agency's publishing status
/version
Get the deployed API version