Interface language English
SDK engine

Google Images Related Content

Related images and related searches by related_content_id from Google Images result.

engine: google_images_related_content TS: XylopSearchEngines.GoogleImagesRelatedContent JS: XylopSearchEngines.GoogleImagesRelatedContent C#: XylopSearchEngines.GoogleImagesRelatedContent Python: XylopSearchEngines.GOOGLE_IMAGES_RELATED_CONTENT PHP: XylopSearchEngines::GOOGLE_IMAGES_RELATED_CONTENT Ruby: XylopApiClient::Engines::GOOGLE_IMAGES_RELATED_CONTENT Java: XylopSearchEngines.GOOGLE_IMAGES_RELATED_CONTENT Kotlin: XylopSearchEngines.GOOGLE_IMAGES_RELATED_CONTENT Swift: XylopSearchEngines.googleImagesRelatedContent Dart: XylopSearchEngines.googleImagesRelatedContent C++: xylop::api::engines::google_images_related_content Go: xylop.EngineGoogleImagesRelatedContent GET /search
TypeScript example

Call via @xylop/api-client-typescript

import { XylopSearchClient, XylopSearchEngines } from "@xylop/api-client-typescript";

interface SearchResponse {
  [key: string]: unknown;
}

const client = new XylopSearchClient({
  apiKey: "YOUR_API_KEY"
});

const response = await client.search<SearchResponse>(
  XylopSearchEngines.GoogleImagesRelatedContent,
  {
    related_content_id: "images_results.related_content_id",
    q: "coffee",
    hl: "en",
    gl: "us",
  });

The TypeScript SDK is written in TypeScript, generates `.d.ts`, supports generic response type and works via `fetch`.

JavaScript example

Call via @xylop/api-client

import { XylopSearchClient, XylopSearchEngines } from "@xylop/api-client";

const client = new XylopSearchClient({
  apiKey: "YOUR_API_KEY"
});

const response = await client.search(
  XylopSearchEngines.GoogleImagesRelatedContent,
  {
    related_content_id: "images_results.related_content_id",
    q: "coffee",
    hl: "en",
    gl: "us",
  });

JavaScript SDK works in Node.js 18+ and modern browsers via `fetch`; TypeScript declarations are included in the npm package.

C# example

Call via XylopSearchClient

using Xylop.Api.Client;

var client = new XylopSearchClient(new HttpClient(), "YOUR_API_KEY");

using var response = await client.SearchJsonAsync(
    XylopSearchEngines.GoogleImagesRelatedContent,
    new Dictionary<string, string?>
    {
        ["related_content_id"] = "images_results.related_content_id",
        ["q"] = "coffee",
        ["hl"] = "en",
        ["gl"] = "us",
    });

For typed mode, use `SearchAsync<TResponse>` and the response model from `Xylop.Logic.SerpApiResponses.*`, which is included in the C# SDK.

Python example

Call via xylop-api-client

from xylop_api_client import XylopSearchClient, XylopSearchEngines

client = XylopSearchClient("YOUR_API_KEY")

response = client.search(
    XylopSearchEngines.GOOGLE_IMAGES_RELATED_CONTENT,
    {
        "related_content_id": "images_results.related_content_id",
        "q": "coffee",
        "hl": "en",
        "gl": "us",
    },
)

The Python SDK returns JSON as normal `dict`/`list` and does not require runtime dependencies.

PHP example

Call via xylop/api-client

<?php

use Xylop\Api\Client\XylopSearchClient;
use Xylop\Api\Client\XylopSearchEngines;

$client = new XylopSearchClient('YOUR_API_KEY');

$response = $client->search(
    XylopSearchEngines::GOOGLE_IMAGES_RELATED_CONTENT,
    [
        'related_content_id' => 'images_results.related_content_id',
        'q' => 'coffee',
        'hl' => 'en',
        'gl' => 'us',
    ]
);

PHP SDK uses standard stream wrappers, returns a decoded JSON array and does not require runtime dependencies.

Ruby example

Call via xylop-api-client

require "xylop_api_client"

client = XylopApiClient::Client.new(api_key: "YOUR_API_KEY")

response = client.search(
  XylopApiClient::Engines::GOOGLE_IMAGES_RELATED_CONTENT,
  {
    "related_content_id" => "images_results.related_content_id",
    "q" => "coffee",
    "hl" => "en",
    "gl" => "us",
  }
)

Ruby SDK uses standard `net/http`, `json` and returns JSON as normal Hash/Array values.

Java example

Call via xylop-api-client

import java.util.Map;
import ru.xylop.api.client.XylopSearchClient;
import ru.xylop.api.client.XylopSearchEngines;

var client = new XylopSearchClient("YOUR_API_KEY");

String responseJson = client.searchJson(
    XylopSearchEngines.GOOGLE_IMAGES_RELATED_CONTENT,
    Map.of(
        "related_content_id", "images_results.related_content_id",
        "q", "coffee",
        "hl", "en",
        "gl", "us"
    ));

The Java SDK uses `java.net.http.HttpClient`, returns a JSON string and does not require runtime dependencies.

Kotlin example

Call via xylop-api-kotlin-client

import ru.xylop.api.kotlin.XylopSearchClient
import ru.xylop.api.kotlin.XylopSearchEngines

val client = XylopSearchClient("YOUR_API_KEY")

val responseJson = client.searchJson(
    XylopSearchEngines.GOOGLE_IMAGES_RELATED_CONTENT,
    mapOf(
        "related_content_id" to "images_results.related_content_id",
        "q" to "coffee",
        "hl" to "en",
        "gl" to "us",
    ),
)

Kotlin SDK uses the JVM `HttpClient`, returns a JSON string and leaves the JSON mapping to the application.

Swift example

Call via XylopApiClient

import XylopApiClient

let client = XylopSearchClient(apiKey: "YOUR_API_KEY")

let response = try await client.searchJSON(
    engine: XylopSearchEngines.googleImagesRelatedContent,
    parameters: [
        "related_content_id": "images_results.related_content_id",
        "q": "coffee",
        "hl": "en",
        "gl": "us",
    ]
)

Swift SDK uses Foundation `URLSession`, supports async/await and returns Data, JSONSerialization values or caller-owned Decodable models.

Dart example

Call via xylop_api_client

import 'package:xylop_api_client/xylop_api_client.dart';

Future<void> main() async {
  final client = XylopSearchClient('YOUR_API_KEY');

  final response = await client.search(
    XylopSearchEngines.googleImagesRelatedContent,
    <String, Object?>{
      'related_content_id': 'images_results.related_content_id',
      'q': 'coffee',
      'hl': 'en',
      'gl': 'us',
    },
  );

  print(response);
}

The Dart SDK uses `dart:io`, returns decoded JSON or raw response text, and does not require runtime dependencies.

C++ example

Call via Xylop.Api.Cpp

#include <xylop/api/client.hpp>
#include <xylop/api/curl_transport.hpp>

int main()
{
    xylop::api::search_client client(
        "YOUR_API_KEY",
        xylop::api::curl_transport);

    auto response_json = client.search_text(
        xylop::api::engines::google_images_related_content,
        {
            {"related_content_id", "images_results.related_content_id"},
            {"q", "coffee"},
            {"hl", "en"},
            {"gl", "us"},
        });

    return 0;
}

The C++ SDK has a header-only C++17 core, accepts a transport callback and can use the optional libcurl adapter `xylop::api::curl_transport`.

Go example

Call via Xylop.Api.Go

package main

import (
    "context"
    "log"

    xylop "github.com/Leonid-Vizel/Xylop.AdminPanel/src/Xylop.Api.Go"
)

func main() {
    client, err := xylop.NewClient("YOUR_API_KEY")
    if err != nil {
        log.Fatal(err)
    }

    var response map[string]any
    err = client.SearchJSON(
        context.Background(),
        xylop.EngineGoogleImagesRelatedContent,
        xylop.Params(map[string]string{
            "related_content_id": "images_results.related_content_id",
            "q": "coffee",
            "hl": "en",
            "gl": "us",
        }),
        &response)
    if err != nil {
        log.Fatal(err)
    }
}

The Go SDK returns raw JSON bytes or decodes the response into a custom structure, `map[string]any` or another target.

Endpoint

HTTP contract

URL
https://api.xylop.ru/search
Engine
google_images_related_content
API key
The SDK is transferred automatically from the client settings.
Input parameters

Request parameters

Parameter Type Required Meaning Description
api_key SDK string Yes — Xylop API key. In the SDK it is set once in the settings or client designer.
engine SDK string Yes google_images_related_content Google Images Engine Related Content.
related_content_id string Yes images_results.related_content_id ID from google_images.images_results.
q string No coffee It's better to pass the original request to Google Images.
hl string No en Interface language.
gl string No us Country code.
Output parameters

Response fields

Field Type Source Description
search_metadata object Sample answer Request metadata: status, identifier, execution time and service information of the provider.
search_parameters object Sample answer The normalized parameters with which the upstream search performed the request.
related_content array Sample answer Typed response field for this engine; the structure depends on the upstream provider and request parameters.
related_searches array Sample answer Related search terms that you can use for your next search.
see_more_link string Sample answer Typed response field for this engine; the structure depends on the upstream provider and request parameters.
serpapi_see_more_link string Sample answer Typed response field for this engine; the structure depends on the upstream provider and request parameters.
JSON

Sample answer

{
  "search_metadata": {
    "id": "644bab2dde98340723972102",
    "status": "Success",
    "google_images_related_content_url": "https://www.google.com/_/VisualFrontendUi/data/batchexecute?hl=en&gl=us"
  },
  "search_parameters": {
    "engine": "google_images_related_content",
    "hl": "en",
    "gl": "us",
    "q": "coffee",
    "related_content_id": "Y0hoQW1Kcnc4RXRiV01cIixcIlU2b0pNbkYtZWVWVEFN"
  },
  "related_content": [
    {
      "position": 1,
      "title": "Coffee image source",
      "source": "Example",
      "source_icon": "https://serpapi.com/searches/.../images/icon.png",
      "link": "https://example.com/coffee",
      "original": "https://example.com/coffee.jpg",
      "original_width": 1200,
      "original_height": 800,
      "thumbnail": "https://serpapi.com/searches/.../images/thumb.png",
      "thumbnail_width": 261,
      "thumbnail_height": 193,
      "related_content_id": "Wld5bWhqN053VG85SE1cIixcIjQ4Wjl4akpyZXdiV2JN",
      "serpapi_related_content_link": "https://serpapi.com/search.json?engine=google_images_related_content&related_content_id=..."
    }
  ],
  "related_searches": [
    {
      "position": 1,
      "query": "coffee cup",
      "link": "https://www.google.com/search?q=coffee+cup&udm=2",
      "serpapi_link": "https://serpapi.com/search.json?engine=google_images&q=coffee+cup",
      "thumbnail": "https://serpapi.com/searches/.../images/related.jpeg"
    }
  ],
  "see_more_link": "https://www.google.com/search?q=coffee&udm=2",
  "serpapi_see_more_link": "https://serpapi.com/search.json?engine=google_images&q=coffee"
}