Digital.gov Guide

Optimizing site search with SearchGov

Learn about SearchGov — a configurable search engine built by the government, for the government, with the government. 
Illustration of analytics and search graphics and people

SearchGov: Setting up your federal search experience

Read this guide to help you get started with SearchGov.

Designed for public-facing federal websites, SearchGov provides a search engine that indexes live production content that is accessible to any user. The tool helps your visitors find information quickly by providing relevant results from the websites of your choice and with minimal code changes required.

This guide will walk you through setup, step by step.

Before you begin: The 90-day rule

You must sign in to your SearchGov account at least once every 90 days or your access will automatically be turned off.

This matters most for teams getting ready to launch. If you finish setup and then step away for a few months, you could lose access right before you're ready to go live. Set a recurring reminder now, for everyone on your team who has access.

If your account does get deactivated, a teammate can turn your access back on through "Manage Users." Or, you can email the SearchGov team at search@gsa.gov for help.

Step 1. Create your account

SearchGov uses Login.gov to securely handle sign-in.

Who can sign up: You'll need an official government email address (ending in .gov or .mil). If you are a contractor without a .gov or .mil email address, have a federal contact at your agency reach out to us. Personal email addresses and shared team inboxes won't work with SearchGov.

How to sign up

  1. Go to search.usa.gov/signup.
  2. Check your email for a message from Login.gov and confirm your address.
  3. Set up at least one extra security step, like an authentication app or a text-message code. This is required to keep your account safe.

If you get stuck, Login.gov has its own help center that walks through common issues. If you have more than one email address associated with your Login.gov account, make sure that your government account is shared with SearchGov.

Common account issues

  • Forgot your password? Login.gov manages all passwords, not SearchGov.
  • Account deactivated? A colleague with access can reactivate you on the Manage Users page, or email the SearchGov team.
  • Signed up with a personal email before? If Login.gov shows both a personal and a government email connected to your name, double-check under "Connected Accounts" that your SearchGov access is tied to your government email.

Step 2. Know what SearchGov can and can’t index

SearchGov only indexes publicly accessible, live production content.

It can index:

  • HTML pages
  • PDF documents

It cannot index:

  • Sites or pages behind a login
  • Internal or intranet sites
  • Content blocked by a firewall or authentication
  • Other file types like .docx, .pptx, and .txt.

If a page isn't something a member of the public could already visit directly, SearchGov won't be able to include it in results.

Step 3. Create your SearchGov "site"

A site is where you make all of the settings that control what pages your search box searches and how your search results pages look.

  1. Create your site. In the Admin Center, enter your site's homepage address and give it a display name. The display name will appear on your results pages. The Site Handle is unique to your site and will appear in the url of your search results.
  2. Add your domains. List the web addresses you want included in search results. You can add one web domain or several, depending on how much you want people to be able to search.
  3. Preview your results. Click the eye-shaped icon in the Admin Center to open a preview of your results page. Try searching for a word you know appears often on your site, like your agency's name.
    • If results appear, we have your website indexed already.
    • If nothing appears, your site likely hasn't been indexed yet. Email the SearchGov team at search@gsa.gov and let us know about your domain. If the website has an XML sitemap file, we can probably start indexing right away.
  4. Add optional extras.
    • Collections let you create a narrower or broader version of search, for example, a search that only covers your blog, or one that spans several related agency sites at once.
    • Best bets let you pin your most important pages to the top of results for specific search terms, like your most-used form.

Step 4. Design your results page

There are several options you can use to make the results page match the design of your website. You can set fonts and colors and upload your logo in the Display section of the Admin Center.

You can also add header links to support navigation between your website and the search results page to create a more seamless experience.

If you created any collections, you can select the option to display them on the Display Overview page in the Admin Center.

Use the Preview option in the Admin Center to preview the design.

Review Design your results page for more information.

Step 5. Connect the search box on your website

This is the step that makes SearchGov actually power your site's search box.

Copy your site's form code from the Activate section of the Admin Center. It is unique to your site. Or, you can use the code below. Just replace YourSiteHandle with your site handle, which you can find on the Settings page in the Admin Center.

<form accept-charset="UTF-8" action="https://search.usa.gov/search" 
id="search_form"method="get">
   <div style="margin: 0;padding: 0;display: inline;"> 
       <input name="utf8" type="hidden" value="&#x2713;"/>
   </div>
   <input id="affiliate" name="affiliate" type="hidden" value="YourSiteHandle"/>
   <label for="query">Enter Search Term(s):</label> 
   <input autocomplete="off" class="usagov-search-autocomplete" id="query" 
   name="query" type="text"/>
   <input name="commit" type="submit" value="Search"/>
</form>

Step 6. Hosted results page vs. API: Which should you use?

Most agencies use the standard hosted results page covered above. However, if your team wants full control over how results look and behave, SearchGov also offers an API that lets you pull results directly into your own site's design.

Comparison table

Features

Hosted results page

API (build it yourself)

Setup effort

Low — mostly configuration

Higher — requires custom development

Design control

Good, within SearchGov's design options

Full control

Who maintains it

SearchGov

Your team, ongoing

Best for

Most federal websites

Teams with dedicated designers and engineers who want a fully custom experience

APIs for developers

If you don’t want to use the hosted search results page, you can use the APIs, which allow you to display results within your own website.

  • Search results API. Use the search results API to receive web results, best bets, news, and videos in one JSON call.
  • Clicks API. Use the clicks API with the Search results API to send click data to SearchGov.

While using the APIs gives you more control over the look and feel of the search results, you will need a team of designers, engineers, and other digital service experts to create your search experience and maintain it over time.

Step 7 - Managing users

SearchGov lets you control who has access to your account, and lets you update some basic information about your site.

Managing your users

  • Who can be added: Only real people with official government email addresses. Personal email accounts (Gmail, Yahoo, AOL, etc.) and shared team inboxes (like webteam@domain-name.gov) aren’t allowed. Login.gov doesn’t support group accounts.
  • The 90-day rule applies to every person, not just the account owner: Each individual user must sign in at least once every 90 days, or their access is automatically turned off.
  • Reactivating someone: If a teammate's account times out, you can turn it back on for them from the Manage Users page in the Admin Center.
  • When someone leaves your team: Remove their access right away so your account stays secure.