필터 지우기
필터 지우기

twitter error "HTTP/1.1 403 Forbidden'"

조회 수: 8 (최근 30일)
Michael Robbins
Michael Robbins 2024년 7월 15일
댓글: Michael Robbins 2024년 7월 16일
Hello, I seem to have a good connection but I'm receiving a "HTTP/1.1 403 Forbidden'" error. Please see below. Thanks.
>> c
c =
twitter with properties:
Name: 'MyName'
ScreenName: 'MyScreenName'
MetaData: [1×1 struct]
StatusCode: OK
>> d = search(c,'#MySearch')
d =
ResponseMessage with properties:
StatusLine: 'HTTP/1.1 403 Forbidden'
StatusCode: Forbidden
Header: [1×10 matlab.net.http.HeaderField]
Body: [1×1 matlab.net.http.MessageBody]
Completed: 0
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 24.2.0.2622594 (R2024b) Prerelease
MATLAB License Number: Prerelease
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19045)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 24.2 (R2024b)
...
Datafeed Toolbox Version 24.2 (R2024b)
...
  댓글 수: 1
Steven Lord
Steven Lord 2024년 7월 15일
The object stored in the Body property of d should have a Data property. Does that show anything that looks relevant to this 403 error message? You may want to call string on the Body property if it's not showing the data as text.

댓글을 달려면 로그인하십시오.

답변 (1개)

Michael Robbins
Michael Robbins 2024년 7월 15일
Thanks. There is a more descriptive message there but I'm not sure what the solution is. It reads that I need a higher level of access than the free API service. Do you have any suggestions? Thanks.
d.Body.Data.errors
ans = struct with fields:
message: 'You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product'
code: 453
  댓글 수: 2
Walter Roberson
Walter Roberson 2024년 7월 15일
편집: Walter Roberson 2024년 7월 15일
I vaguely remember that twitter cut out bots from its free service. Your access is effectively bot access. You will need higher level access.. which probably means that you will need verified (paid) access.
Michael Robbins
Michael Robbins 2024년 7월 16일
Thanks. Do you know of another way to read tweets (and LinkedIn and Reddit posts) from MATLAB?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Call Web Services from MATLAB Using HTTP에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by