Using Java to Bulk Submit URLs to Google Search Console

Java-Bulk Submit URLs to Google Search Console

Today in this article, we will learn how to perform Java-Bulk Submit URLs to Google Search Console. We will Java example to Bulk Submit URLs to Google Search Engine/Console for Indexing or Crawling purpose.

Updated November 2026: a section on what the Indexing API supports, a batching, quota and error handling section, and an FAQ.

We already learned how to set up the service account, project, and other configurations so that we can leverage Google’s Indexing API before.

Today in this article, we will cover below aspects,

If you have not performed mandatory prerequisites, please follow the below article for more details,

You may find the need to submit the URLs due to many reasons like article update due to new data or upgrade or article enhancement, etc. In such scenarios, it is always difficult to perform indexing manually.

We shall be using below endpoints required for publishing the URLs,

Step1- Define the scope and endpoint

SCOPES = [ “https://www.googleapis.com/auth/indexing“ ]

ENDPOINT = “https://indexing.googleapis.com/v3/urlNotifications:publish“

In your Java code please define the scopes and endpoint as below,

String scopes = "https://www.googleapis.com/auth/indexing";
String endPoint = "https://indexing.googleapis.com/v3/urlNotifications:publish";

What the Indexing API Can and Can't Do for Bulk URL Submission

Google documents the Indexing API for pages with JobPosting or BroadcastEvent (livestream) structured data. It isn’t a general-purpose bulk indexing tool, and a successful call doesn’t guarantee your page will be indexed.

What does a notification actually do?

The API accepts only two notification types: URL_UPDATED asks Google to crawl a URL, and URL_DELETED asks for its removal. Both are requests. Google still evaluates the page’s quality afterwards, so a 200 response only tells you the notification was received.

Does the Search Console API have a Request Indexing endpoint?

No. The button in the Search Console UI has no API equivalent. Two Search Console API services are easy to mistake for one:

  • URL Inspection API: reads a page’s index status only. It can’t request indexing.
  • sitemaps.submit: submits a sitemap file. It doesn’t request indexing for the URLs inside it.

What should you use for large numbers of ordinary pages?

Use sitemaps.submit. It’s the supported route for blogs, product pages and other regular content. It needs the read-write Search Console scope, and the call takes the property and the full sitemap URL.

A successful submit doesn’t mean Google has processed the sitemap. Check the sitemap’s status in Search Console afterwards rather than assuming it was read.

What about the manual Request Indexing button?

The button in the Search Console UI has a small daily cap per property, not per user. Google publishes no official number. Practitioners report roughly 10 to 12 URLs a day, so treat that as a rough guide.

Which rules apply to what you submit?

Google’s spam policies apply to submitted content. Google also says not to get around submission limits by spreading calls across multiple accounts or service accounts.

Warning: Splitting calls across several service accounts to beat a quota breaks Google’s guidance. If you need more capacity for eligible pages, request a higher quota instead.

Step2 – Include the service account access token

Please include the service account access token in your code. In the last article, we generated a service account token thecodebuzz-da659b2b8b0d.json which is the private key that you use to authenticate the service account using OAuth2.

For more details :

  • Create Service account JSON for Google Indexing API
  • Step3 – Define the body of the request and invoke API

    Below is a sample Java code that can be used to send Bulk URLs to Indexing API

    JsonFactory jsonFactory = new JacksonFactory();
    
    // thecodebuzz-da659b2b8b0d.json is the private key that you created for your service account.
    InputStream in = IOUtils.toInputStream("thecodebuzz-da659b2b8b0d.json");
    
    GoogleCredential credentials =
      GoogleCredential.fromStream(in, this.httpTransport, jsonFactory).createScoped(Collections.singleton(scopes));
    
    GenericUrl genericUrl = new GenericUrl(endPoint);
    HttpRequestFactory requestFactory = this.httpTransport.createRequestFactory();
    
    // Define all URLs to be submitted to API
    
    String content = "{"
      + "\"url\": \"http://your url .com\","
      + "\"type\": \"URL_UPDATED\","
      + "}";
    
    
    HttpRequest request =
      requestFactory.buildPostRequest(genericUrl, ByteArrayContent.fromString("application/json", content));
    
    credentials.initialize(request);
    HttpResponse response = request.execute();
    int statusCode = response.getStatusCode();
    
    
    
    

    • In the above code content is defined to contain the URL to be submitted.
    • We have to define request format as “application/json”
    • getStatusCode lets you verify the status code after executing the API

    Once successfully submitted the URLs for indexing, you can see the status code as 200 for the request. This means Google accepted the notification, not that the page has been crawled or indexed.

    JAVA for Bulk Submit URLs to Google indexing,index url google using script , index url google search engine seo,submit to google for indexing,add to google index, google add url to index, google to crawl and index your url, submit url for indexing, bulk url indexer, submit url for indexing, google add website to index , google indexing api-python, bulk request indexing google, google submit url for indexing, google submit page for indexing, google console index

    References :

    Please follow the below article for more details on prerequisites,

    Do you have any comments or ideas or any better suggestions to share?

    Please sound off your comments below.

    Happy Coding !!



    Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published (2026) best practices and guidelines for software design and development.



    Frequently asked questions

    Can the Indexing API be used for normal pages, or only job postings and livestreams?

    Google documents the Indexing API for JobPosting and BroadcastEvent (livestream) pages only. Calls for other pages may be accepted, but Google doesn’t promise to index them. For ordinary pages, submit a sitemap and keep it up to date.

    Does the Search Console API have a Request Indexing endpoint?

    No. The URL Inspection API only reports index status, and sitemaps.submit only submits a sitemap file. The Request Indexing button in the Search Console UI has no API equivalent.

    How many URLs fit in one Indexing API batch request, and how many can I submit per day?

    A batch holds up to 100 calls, but batching doesn’t reduce quota use. Each call still counts as one request. The default daily quota is commonly cited as 200 publish requests per project, though that figure comes from third-party sources. Check your own quota page in the Google Cloud Console and request an increase there if you need one.

    Why do I get a 403 permission error from the Indexing API?

    Most often, the service account hasn’t been added as an owner of the Search Console property. Use the client_email value from the downloaded JSON key when you add it. Also confirm that the Indexing API is enabled in your project and that the scope is https://www.googleapis.com/auth/indexing.

    2 thoughts on “Java-Bulk Submit URLs to Google Search Console”

    Leave a Reply

    Your email address will not be published. Required fields are marked *