Search code examples
google-people-api

What is the maximum number of results for people.searchContacts?


The PeopleAPI reference says how many is the maximum number of people.searchContacts?

There is a parameter in people.searchContacts that specifies the PageSize, and the possible range for this is 0-100 (if this is exceeded, the API will return an error with code 400).

In fact, the maximum number of contacts returned in my environment is 10.

When I call the API, I am doing so from the PeopleAPI reference. I have contacts with only names from "test001" to "test692".

I made the following call.

pageSize=100 
query=test 
readMask=names 

In fact, the search is successful because 10 results are returned. The actual API response is as follows. Obviously, the object PERSON is only 10.

{
  "results": [
    {
      "person": {
        "resourceName": "people/c8168479585467794596",
        "etag": "%EgUBAj03LhoBAiIMNnpSRkhHZGx0MWc9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "715c44e78ed684a4"
              }
            },
            "displayName": "test344",
            "givenName": "test344",
            "displayNameLastFirst": "test344",
            "unstructuredName": "test344"
          }
        ]
      }
    },
    {
      "person": {
        "resourceName": "people/c3167515375063584231",
        "etag": "%EgUBAj03LhoBAiIMYXNYSDFwK2F5M2s9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "2bf546738f40cde7"
              }
            },
            "displayName": "test475",
            "givenName": "test475",
            "displayNameLastFirst": "test475",
            "unstructuredName": "test475"
          }
        ]
      }
    },
    {
      "person": {
        "resourceName": "people/c3282072175076995161",
        "etag": "%EgUBAj03LhoBAiIMNnpSRkhHZGx0MWc9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "2d8c43410aa87059"
              }
            },
            "displayName": "test324",
            "givenName": "test324",
            "displayNameLastFirst": "test324",
            "unstructuredName": "test324"
          }
        ]
      }
    },
    {
      "person": {
        "resourceName": "people/c93297420873589595",
        "etag": "%EgUBAj03LhoBAiIMNnpSRkhHZGx0MWc9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "14b75828da1635b"
              }
            },
            "displayName": "test375",
            "givenName": "test375",
            "displayNameLastFirst": "test375",
            "unstructuredName": "test375"
          }
        ]
      }
    },
    {
      "person": {
        "resourceName": "people/c7551199169689611221",
        "etag": "%EgUBAj03LhoBAiIMYXNYSDFwK2F5M2s9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "68cb3fa30992ebd5"
              }
            },
            "displayName": "test410",
            "givenName": "test410",
            "displayNameLastFirst": "test410",
            "unstructuredName": "test410"
          }
        ]
      }
    },
    {
      "person": {
        "resourceName": "people/c1565155306977622025",
        "etag": "%EgUBAj03LhoBAiIMYXNYSDFwK2F5M2s9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "15b88c758ab7f809"
              }
            },
            "displayName": "test502",
            "givenName": "test502",
            "displayNameLastFirst": "test502",
            "unstructuredName": "test502"
          }
        ]
      }
    },
    {
      "person": {
        "resourceName": "people/c5338499009621013269",
        "etag": "%EgUBAj03LhoBAiIMOG5lYXFOY2dSMEk9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "4a1628908e3c3315"
              }
            },
            "displayName": "test045",
            "givenName": "test045",
            "displayNameLastFirst": "test045",
            "unstructuredName": "test045"
          }
        ]
      }
    },
    {
      "person": {
        "resourceName": "people/c1634993899755826693",
        "etag": "%EgUBAj03LhoBAiIMeFhRTGVVTUpwV1U9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "16b0aa4a0ce06e05"
              }
            },
            "displayName": "test682",
            "givenName": "test682",
            "displayNameLastFirst": "test682",
            "unstructuredName": "test682"
          }
        ]
      }
    },
    {
      "person": {
        "resourceName": "people/c2147830404560755472",
        "etag": "%EgUBAj03LhoBAiIMYXNYSDFwK2F5M2s9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "1dcea05f8da09b10"
              }
            },
            "displayName": "test412",
            "givenName": "test412",
            "displayNameLastFirst": "test412",
            "unstructuredName": "test412"
          }
        ]
      }
    },
    {
      "person": {
        "resourceName": "people/c1471134701871216797",
        "etag": "%EgUBAj03LhoBAiIMNnpSRkhHZGx0MWc9",
        "names": [
          {
            "metadata": {
              "primary": true,
              "source": {
                "type": "CONTACT",
                "id": "146a853789c8b89d"
              }
            },
            "displayName": "test257",
            "givenName": "test257",
            "displayNameLastFirst": "test257",
            "unstructuredName": "test257"
          }
        ]
      }
    }
  ]
}

The groups to be searched are as follows

{
  "resourceName": "contactGroups/70239db70d7a542c",
  "etag": "oa89KnGjASc=",
  "metadata": {
    "updateTime": "2021-04-13T03:38:14.374Z"
  },
  "groupType": "USER_CONTACT_GROUP",
  "name": "インポート: 4/13",
  "formattedName": "インポート: 4/13",
  "memberCount": 691
}

Solution

  • I could reproduce your problem and can confirm that the number of returned results is capped to 10

    It seems to be a bug.

    I have taken the liberty of filing it for you on Google Issue Tracker.

    I recommend you to "star" it to increase visibility.