AndroidKotlinJavaRetrofitOkHttp27 Languages

Vedic Astrology API
for Android Apps

Integrate kundali, horoscope, panchang, and dasha APIs into your Android app with Retrofit and Kotlin coroutines. Java OkHttp example included.

27 language support — build truly regional Android apps for Hindi, Tamil, Telugu, and 24 more languages without managing translation files.

Get Free API Key →API Docs

Android Integration — Step by Step

1
Add internet permission (AndroidManifest.xml)
AndroidManifest.xml
<!-- AndroidManifest.xml — add internet permission -->
<uses-permission android:name="android.permission.INTERNET" />
2
Define the Retrofit service interface (Kotlin)
AstroApiService.kt
// AstroApiService.kt
import retrofit2.http.GET
import retrofit2.http.Query

interface AstroApiService {

    @GET("api/v1/extended-horoscope/find-ascendant")
    suspend fun getAscendant(
        @Query("api_key") apiKey: String,
        @Query("dob") dob: String,       // DD/MM/YYYY
        @Query("tob") tob: String,       // HH:MM (24hr)
        @Query("lat") lat: Double,
        @Query("lon") lon: Double,
        @Query("tz") tz: Double,
        @Query("lang") lang: String = "en"  // "hi", "ta", "te" etc
    ): AscendantResponse

    @GET("api/v1/panchang/panchang")
    suspend fun getPanchang(
        @Query("api_key") apiKey: String,
        @Query("date") date: String,     // DD/MM/YYYY
        @Query("lat") lat: Double,
        @Query("lon") lon: Double,
        @Query("tz") tz: Double,
        @Query("lang") lang: String = "en"
    ): PanchangResponse
}
3
Create the Retrofit singleton
RetrofitClient.kt
// RetrofitClient.kt
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit

object RetrofitClient {
    private const val BASE_URL = "https://vedintelastroapi.com/"

    private val client = OkHttpClient.Builder()
        .connectTimeout(10, TimeUnit.SECONDS)
        .readTimeout(15, TimeUnit.SECONDS)
        .addInterceptor(HttpLoggingInterceptor().apply {
            level = HttpLoggingInterceptor.Level.BODY
        })
        .build()

    val astroApi: AstroApiService = Retrofit.Builder()
        .baseUrl(BASE_URL)
        .client(client)
        .addConverterFactory(GsonConverterFactory.create())
        .build()
        .create(AstroApiService::class.java)
}
4
Call from a ViewModel using coroutines
AstroViewModel.kt
// ViewModel using Kotlin coroutines
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow

class AstroViewModel : ViewModel() {
    private val apiKey = "vai_YOUR_KEY"

    private val _ascendant = MutableStateFlow<String?>(null)
    val ascendant: StateFlow<String?> = _ascendant

    fun fetchAscendant(dob: String, tob: String, lat: Double, lon: Double, tz: Double, lang: String = "en") {
        viewModelScope.launch {
            try {
                val result = RetrofitClient.astroApi.getAscendant(
                    apiKey = apiKey,
                    dob = dob,
                    tob = tob,
                    lat = lat,
                    lon = lon,
                    tz = tz,
                    lang = lang
                )
                _ascendant.value = result.response.ascendant
                // result.remaining_api_calls tells you calls left this month
            } catch (e: Exception) {
                // Handle network or API errors
            }
        }
    }
}
J
Java alternative — OkHttp (no Retrofit needed)
AstroApiClient.java
// Java — OkHttp (no Retrofit dependency needed)
import okhttp3.*;
import org.json.*;
import java.io.IOException;

public class AstroApiClient {
    private static final String BASE = "https://vedintelastroapi.com/api/v1/";
    private final OkHttpClient http = new OkHttpClient();
    private final String apiKey = "vai_YOUR_KEY";

    public void getAscendant(String dob, String tob,
                              double lat, double lon, double tz,
                              Callback callback) {
        String url = BASE + "extended-horoscope/find-ascendant"
            + "?api_key=" + apiKey
            + "&dob=" + dob
            + "&tob=" + tob
            + "&lat=" + lat
            + "&lon=" + lon
            + "&tz=" + tz;

        Request request = new Request.Builder().url(url).build();
        http.newCall(request).enqueue(new okhttp3.Callback() {
            @Override
            public void onResponse(Call call, Response response) throws IOException {
                try {
                    JSONObject json = new JSONObject(response.body().string());
                    JSONObject resp = json.getJSONObject("response");
                    String ascendant = resp.getString("ascendant");
                    // Use ascendant on UI thread
                } catch (JSONException e) { /* handle */ }
            }
            @Override public void onFailure(Call call, IOException e) { /* handle */ }
        });
    }
}

Why Android Developers Choose VedIntel™

20 req/sec on free plan
Generous rate limit even on the free tier — enough for active testing during development.
Under 200ms cached
Natal chart results cached permanently. Returning users get sub-200ms response times.
27 regional languages
Pass lang=hi, lang=ta, lang=te and build truly regional Android apps without a translation layer.
Simple GET requests
No SDKs, no OAuth flows — plain HTTP GET with an API key. Works with OkHttp, Retrofit, or Volley.
All categories unlocked
Horoscope, panchang, dasha, matching, dosha, predictions — all 116 endpoints work the same way.
Clean JSON responses
Consistent envelope: { status, response, remaining_api_calls }. Predictable and easy to map to data classes.

Android API — FAQs

What are the minimum Android requirements to use this API?
The API uses standard HTTPS (TLS 1.2+). minSdkVersion 21 (Android 5.0 Lollipop) is sufficient. The internet permission must be declared in AndroidManifest.xml. Beyond that, any HTTP client works — OkHttp, Retrofit, Ktor, or even HttpURLConnection. There is no native SDK to install.
How do I handle the lang parameter for multi-language Android apps?
Store the user's preferred language code (hi, ta, te, kn, ml, bn, mr, gu, pa, en, etc.) in SharedPreferences or a Room database. Pass it as the lang query parameter on every API call. The API returns all labels, descriptions, and interpretive text in the requested language. You do not need to manage any translation files — the API handles all 27 languages server-side.
How do I cache API results to avoid hitting rate limits on Android?
For natal chart data (ascendant, planet positions, divisional charts) — cache in Room database using a key derived from dob+tob+lat+lon+tz. This data never changes for a given birth record. For time-sensitive data (panchang, transits, current dasha) — cache with a TTL (e.g. 1 hour for panchang, 24 hours for weekly predictions). The API itself also caches natal charts permanently, so repeated identical requests are fast.
Is there a rate limit that could affect my Android app in production?
The free plan allows 20 requests per second and 500 calls per month. For a production app, upgrade to Developer (₹750/month, 5,000 calls, 30 req/sec) or Starter (₹4,100/month, 1,00,000 calls, 50 req/sec). Rate limit errors return a 429 status with a clear message. Implement exponential backoff in your Retrofit or OkHttp error handling for resilience.
Related
Free API (500 calls)Hindi API (lang=hi)Tamil API (lang=ta)Enterprise PlanFull Docs

Ship your astrology Android app this week.

500 free calls/month. No credit card. Copy your key and paste into the Retrofit interface above.

Get Your Free API Key →