History and Market AI error AG8004


  • Quick question:
    We’re getting AG8004 – Invalid API Key for the Market Scanner APIs (Gainers/Losers, PCR, OI Buildup), even though our access token is valid and other APIs (orders, profile, etc.) are working fine.

    We are correctly passing the API Key (not the secret) in the header:

    X-PrivateKey: <API_KEY>

    Is there any separate activation, entitlement, or plan requirement for these scanner APIs? Are they disabled by default?

    Sample Market API cURL (masked) available if needed.

    curl --location 'https://apiconnect.angelone.in/rest/secure/angelbroking/marketData/v1/OIBuildup'
    --header 'Authorization: Bearer eyJhbGciOi...<MASKED>'
    --header 'Content-Type: application/json'
    --header 'Accept: application/json'
    --header 'X-UserType: USER'
    --header 'X-SourceID: WEB'
    --header 'X-ClientLocalIP: 1XX.0.0.1'
    --header 'X-ClientPublicIP: 1XX.0.0.1'
    --header 'X-MACAddress: 00:00:00:00:00:00'
    --header 'X-PrivateKey: XXXXXX'
    --data '{
    "datatype": "Long Built Up",
    "expirytype": "NEAR"
    }'


  • @mohan-0 Intermittent issue because of service disruption. Try re-creating the API key if issue persists.