Career Predictions API - React Integration

AI-powered career guidance and predictions

Overview

AI-powered career guidance and predictions

POST /api/v1/astrology/query
Pricing: $0.15 per request | Framework: React | Auth: API Key required

Quick Start

1. Installation

npm install axios
# or
yarn add axios

2. Environment Setup

# .env or .env.local
VEDIKA_API_KEY=your_api_key_here
Security: Never commit API keys to version control. Always use environment variables.

Complete Implementation

import React, { useState } from 'react';
import axios from 'axios';

const CareerPredictionsComponent = () => {
  const [data, setData] = useState(null);
  const [loading, setLoading] = useState(false);
  const [error, setError] = useState(null);

  const fetchCareerPredictions = async (params) => {
    setLoading(true);
    setError(null);

    try {
      const response = await axios.post(
        'https://vedika-api-854222120654.us-central1.run.app/api/v1/astrology/query',
        params,
        {
          headers: {
            'Content-Type': 'application/json',
            'x-api-key': process.env.REACT_APP_VEDIKA_API_KEY
          }
        }
      );

      setData(response.data.data);
      return response.data.data;
    } catch (err) {
      setError(err.response?.data?.error || err.message);
      throw err;
    } finally {
      setLoading(false);
    }
  };

  return (
    
{/* Your UI here */} {loading &&

Loading...

} {error &&

Error: {error}

} {data &&
{JSON.stringify(data, null, 2)}
}
); }; export default CareerPredictionsComponent;

Request Parameters

Parameter Type Required Description
question varies Yes See API documentation
birthDetails varies Yes See API documentation

Error Handling

Status Code Error Solution
400 Bad Request Check request parameters and format
401 Unauthorized Verify API key is correct
402 Payment Required Insufficient balance - recharge at console.vedika.io
429 Rate Limit Exceeded Implement exponential backoff or upgrade plan
500 Server Error Retry after a few seconds

Best Practices

Response Format

{
  "success": true,
  "data": {
    // Endpoint-specific response data
  },
  "timestamp": "2026-01-07T10:30:00Z",
  "cost": 0.15
}

Related Endpoints

Birth Chart Kundli Match Panchang Dasha Periods Dosha Analysis

Other Frameworks

Next.js Vue.js Angular Node.js Python/Flask Django Ruby on Rails

Support

Need help integrating this endpoint?