This is more then likly an issue with sampling.
Google Analytics calculates certain combinations of dimensions and metrics on the fly. To return the data in a reasonable time, Google Analytics may only process a sample of the data.
You can specify the sampling level to use for a request by setting the samplingLevel parameter.
If a Core Reporting API response contains sampled data, then the containsSampledData response field will be true. In addition, 2 properties will provide information about the sampling level for the query: sampleSize and sampleSpace. With these 2 values you can calculate the percentage of sessions that were used for the query. For example, if sampleSize is 201,000 and sampleSpace is 220,000 then the report is based on (201,000 / 220,000) * 100 = 91.36% of sessions.
See Sampling for a general description of sampling and how it is used in Google Analytics.
You can set the sampling level in your request using
samplingLevel=DEFAULT
Unforuntaly you are using the Google Analytics v3 there is no way of knowing from the response data if the data you are seeing is sampled. However if you switch to Google analytics V4 the response tells you if the data it returned is sampled.
You should also note that it is very hard to get the exact results from the API that you are seeing on the Website. the website has difference sampling levels than we can see as developers and there is also a lot of internal calculations that goes into some of those reports. It can be nerve racking to try and get them to match up 100%