カーリング時に403を無効にする

カーリング時に403を無効にする

カールを使用してこのウェブサイトからいくつかの数字をダウンロードしようとしています。https://financialmodelingprep.com/developer/docs#Company-Financial-Statements

リンクをクリックすると正しく開き、正しい結果が表示されます。例えば https://financialmodelingprep.com/api/v3/balance-sheet-statement/AAPL? period=quarter&limit=400&apikey=

しかし、乾燥すると、403 Forbiddenエラーが発生します。

curl https://financialmodelingprep.com/api/v3/balance-sheet-statement/AAPL?period=quarter&limit=400&apikey=<API Key>

<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.14.0 (Ubuntu)</center>
</body>
</html>

[1]+  Done                    curl https://financialmodelingprep.com/api/v3/balance-sheet-statement/AAPL?period=quarter

カールビットを並べ替えると値が与えられますが、値が一致しません。

curl https://financialmodelingprep.com/api/v3/balance-sheet-statement/AAPL?apikey=<API Key>&period=quarter&limit=400

ここで何が起こっているのか分かりません。

PSテスト用のAPIキーを生成するには、アカウントを作成するだけです。もしかして。

ベストアンサー1

シェルで解釈し&、プロセスをバックグラウンドで送信します。実行されたコマンドにはいくつかのパラメーターがなく、次の項目のみが含まれていることがわかります。?period=quarter

シェルの解釈を回避するには、&URLを一重引用符または二重引用符で囲むか、各URLをバックスラッシュでエスケープします\&

curl 'https://financialmodelingprep.com/api/v3/balance-sheet-statement/AAPL?period=quarter&limit=400&apikey=<API Key>'

おすすめ記事