# Can't get request client error 403

**URL:** <https://forum.alpaca.markets/t/cant-get-request-client-error-403/11271>\
**Category:** Alpaca Trading\
**Created:** [December 7, 2022, 2:56am UTC](https://forum.alpaca.markets/t/cant-get-request-client-error-403/11271 "2022-12-07T02:56:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chatofking](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@chatofking](https://forum.alpaca.markets/u/chatofking)\
**Post date:** [December 7, 2022, 2:56am UTC](https://forum.alpaca.markets/t/cant-get-request-client-error-403/11271/1 "2022-12-07T02:56:58Z")

</div>

i can’t fetch data from alpaca [Account - Documentation | Alpaca](https://alpaca.markets/deprecated/docs/api-documentation/api-v2/account/)  
when I try to fetch data from alpaca [GitHub - infinitered/apisauce: Axios + standardized errors + request/response transforms.](https://github.com/infinitered/apisauce)  
using react component [https://reactjs.org/docs/react-component.html](https://reactjs.org/docs/react-component.html)

```auto
import alpacaApi from '../services/alpaca'
    componentDidMount() {
        console.log('fetch data from alpaca')

        const api = alpacaApi()

        api.getAccount().then((response) => {
            console.log(response)
        })
    }

```

here is alpacaApi.js file

```auto
import apisauce from 'apisauce'

const alpacaApi = (baseURL = config.BASE_URL) => {
    
    const api = apisauce.create({
        baseURL: config.BASE_URL,
        headers: {
            'APACA-API-KEY-ID': config.ALPACA_API_KEY_ID,
            'APACA-API-SECRET-KEY': config.ALPACA_API_SECRET_KEY
        },
        timeout: 5000
    })

    const getAccount = () => api.get('v2/account')
    const getPostitions = () => api.get('v2/positions')

    return {
        getAccount,
        getPostitions
    }
}

const config = {
    ALPACA_API_KEY_ID: "apikey",
    ALPACA_API_SECRET_KEY: "secretkey",
    BASE_URL: "https://paper-api.alpaca.markets"
}

export default alpacaApi

```

it shows error

```auto
 LOG fetch data from alpaca
 LOG {"config": {"adapter": [Function xhrAdapter], "baseURL": "https://paper-api.alpaca.markets", "data": undefined, "headers": {"APACA-API-KEY-ID": "apikey", "APACA-API-SECRET-KEY": "secretkey", "Accept": "application/json"}, "maxBodyLength": -1, "maxContentLength": -1, "method": "get", "params": {}, "timeout": 5000, "transformRequest": [[Function transformRequest]], "transformResponse": [[Function transformResponse]], "transitional": {"clarifyTimeoutError": false, "forcedJSONParsing": true, "silentJSONParsing": true}, "url": "v2/account", "validateStatus": [Function validateStatus], "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN"}, "data": {"message": "forbidden."}, "duration": 956, "headers": {"connection": "keep-alive", "content-length": "26", "content-type": "application/json", "date": "Wed, 07 Dec 2022 02:36:19 GMT"}, "ok": false, "originalError": [Error: Request failed with status code 403], "problem": "CLIENT_ERROR", "status": 403}

```

it didn’t show a properties data.  
what should i do ??

---

<div class="post-metadata">

**Author:** ![PeterM](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@PeterM](https://forum.alpaca.markets/u/PeterM)\
**Post date:** [December 7, 2022, 4:48pm UTC](https://forum.alpaca.markets/t/cant-get-request-client-error-403/11271/2 "2022-12-07T16:48:24Z")

</div>

Hi.

Unless I’m missing something, you haven’t actually defined your API and secret keys in config.

ALPACA\_API\_KEY\_ID: “apikey”,  
ALPACA\_API\_SECRET\_KEY: “secretkey”,

You need to put your actual keys between those quotes.

Cheers

---

<div class="post-metadata">

**Author:** ![chatofking](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@chatofking](https://forum.alpaca.markets/u/chatofking)\
**Post date:** [December 8, 2022, 1:34am UTC](https://forum.alpaca.markets/t/cant-get-request-client-error-403/11271/3 "2022-12-08T01:34:05Z")

</div>

I already put the actual api key & secret key from [Alpaca – Crypto, Stock Trading API](https://app.alpaca.markets/paper/dashboard/overview) but still got error  
[Error: Request failed with status code 403], “problem”: “CLIENT\_ERROR”, “status”: 403}

---

<div class="post-metadata">

**Author:** ![Radzi\_Purba\_LPCA](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/radzi_purba_lpca/32/4297_2.png) [@Radzi\_Purba\_LPCA](https://forum.alpaca.markets/u/Radzi_Purba_LPCA)\
**Post date:** [December 8, 2022, 3:51am UTC](https://forum.alpaca.markets/t/cant-get-request-client-error-403/11271/4 "2022-12-08T03:51:37Z")

</div>

hi @chatofking  
could you please to try your paper credentials here:

> **[Google Colaboratory](https://colab.research.google.com/drive/1Lk8nid4e-Y0W1VRBfrRxNSmX9Eqc9syf?authuser=1)**

i created it on python, it’s just to test if your paper credentials are correct.

it will return you the account’s detail:

 ![Screen Shot 2022-12-08 at 10.51.06](https://us1.discourse-cdn.com/flex020/uploads/alp/original/2X/6/6f88bafa97db8e389c89f3039cf29754bf685835.png)

---

<div class="post-metadata">

**Author:** ![chatofking](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@chatofking](https://forum.alpaca.markets/u/chatofking)\
**Post date:** [December 8, 2022, 6:46am UTC](https://forum.alpaca.markets/t/cant-get-request-client-error-403/11271/5 "2022-12-08T06:46:20Z")

</div>

I made a little typo from APACA to APCA it works now thank for the help.
