Amazon SP-API troubleshoot Search Terms Report

Hi All,

Has anyone succeeded on getting data from GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT using the Amazon SP connector ?

Here is the error message from the connector…
logs-256.txt (23.5 KB)
Also have added as attachment log file.

2022-08-18 08:11:49 e[44msourcee[0m > Syncing stream: GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT
2022-08-18 08:11:49 e[44msourcee[0m > Encountered an exception while reading stream GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py”, line 114, in read
yield from self._read_stream(
File “/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py”, line 173, in _read_stream
for record in record_iterator:
File “/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py”, line 267, in _read_full_refresh
for record in records:
File “/airbyte/integration_code/source_amazon_seller_partner/streams.py”, line 339, in read_records
report_id = self._create_report(sync_mode, cursor_field, stream_slice, stream_state)[“reportId”]
File “/airbyte/integration_code/source_amazon_seller_partner/streams.py”, line 264, in _create_report
report_data = self._report_data(sync_mode, cursor_field, stream_slice, stream_state)
File “/airbyte/integration_code/source_amazon_seller_partner/streams.py”, line 461, in _report_data
options = self.report_options()
File “/airbyte/integration_code/source_amazon_seller_partner/streams.py”, line 321, in report_options
return json_lib.loads(self._report_options).get(self.name)
File “/usr/local/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.9/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.9/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2022-08-18 08:11:49 e[44msourcee[0m > Finished syncing GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT
2022-08-18 08:11:49 e[44msourcee[0m > SourceAmazonSellerPartner runtimes:

Thank you, Rainers

Hi @rainers24, I’m looking into this and should have some ideas for you later today!

1 Like

Hey ! Did you manage to see some problems here ?

Hi @rainers24, I apologize for the late reply - we had team off-site meetings all last week. Are you using Airbyte Cloud by any chance? If so, there is a known authentication issue:
https://github.com/airbytehq/airbyte/issues/14734

Could you try to generate this report manually to double check that it works? You can find Brand Analytics under the Brands tab in Seller Central.

Hey @natalyjazzviolin I can generate the report on Sellercentral, but the error lists itself as json parsing error I guess.

TypeError: the JSON object must be str, bytes or bytearray, not NoneType
2022-09-13 18:51:47 source > Finished syncing GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT
2022-09-13 18:51:47 source > SourceAmazonSellerPartner runtimes:
Syncing stream GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT 0:00:00.001346
2022-09-13 18:51:47 source > the JSON object must be str, bytes or bytearray, not NoneType

Tried also adjusting class BrandAnalyticsStream with json.dumps function, but still the same result.

And I’m using Local version 0.40.5 , all the other reports are coming in okay, but all the BrandAnalytics reports are having the same Json error.

Looking forward to some answer ! Thank you !

Okay, my bad, needed to provide report option for this report…

But still receiving a random error.

2022-09-14 07:19:03 source > 403 Client Error: Forbidden for url: https://sellingpartnerapi-eu.amazon.com/reports/2020-09-04/reports

Is this a airbyte bug or some additional approvals / requests are needed for Amazon ?

You definitely need additional permissions from Amazon! If you’re getting a 403 error when getting the data on amazon.com, then Airbyte would be encountering the same issue.