Login

Concepts

Access Token


Access Token


The access token is a string that contains credentials and permissions for accessing specific resources in the Fincrux API (e.g., company financials, stock data, etc.) or user data (e.g., personalized financial reports or saved queries).


Request an Access Token


alt-text

To obtain an access token, you need to log in with your Email and Password via the /api/auth/login endpoint. This will return a refresh token and an access token which can be used for further API calls.


Request


Send a POST request to the /api/auth/login endpoint with the email and password in the body.

curl -X POST \ -H "Content-Type: application/json" \ --url "https://api.fincrux.org/api/auth/login" \ -d '{"email": "your-email@example.com", "password": "your-password"}'
ParameterDescriptionPriorityType
emailThe email address of the user.requiredstring
passwordThe password associated with the user account.requiredstring

Response


ParameterDescriptionType
successIndicates if the API call was successful or notstring
refreshUsed to obtain a new access token when the current one expires.string
accessThe short-lived access token used for making authorized API requests.string
full_nameThe full name of the authenticated user.string
emailThe authenticated user's email address.string
profile_img_urlThe URL of the user's profile image.string
{ "success": "true", "refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cC", "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjox", "full_name": "Fincrux Client", "email": "example@gmail.com", "profile_img_url": "https://i.ibb.co/B2tZ7h4c/Untitled.png" }

Note: The access token is valid for 1 hour (3600 seconds). After that time, the token expires and you need to request a new one.


Make Your First API Request


To use the access token, you must include the following header in your API calls:

Header ParameterValue
AuthorizationValid access token in the format : JWT {Access Token}

Always include the token in the Authorization header if you are using Access Token method.

You can also use the easier way of using API Keys instead of Access Tokens. Know more here.


Example


curl -X GET \ -H "Content-Type: application/json" \ -H "Authorization: JWT {access_token}" \ --url 'https://api.fincrux.org/api/search/RELIANCE'

Authentication Support


Fincrux API supports both Access Token and API Key authentication methods. You can choose to use either of the two based on your application’s needs. However, you must ensure that only one method is used per API call.


You can learn how to generate and use API Keys here.


Designed & Shipped by Harshit Bansal