> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.vtuagent.com/api-reference/vtu-agent-consumable-api/data/fetch-data-plans/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vtuagent.com/_mcp/server. # Fetch Data Plans GET https://api.vtuagent.com/v1/data/plans Returns every active data bundle across all networks, priced for **your** account tier. The `price` you see is exactly what `POST /v1/data/purchase` will debit. Call this before purchasing to obtain the `plan_id` you need. Only plans with a non-null `plan_id` can be bought through this API. Reference: https://docs.vtuagent.com/api-reference/vtu-agent-consumable-api/data/fetch-data-plans ## Authentication - `Authorization` header (bearer token, required) — API key issued from the VTUAgent dashboard, sent as `Authorization: Bearer {your_api_key}`. ## Response ### 200 List of plans - `status` (enum, required) - Allowed values: `success` - `message` (string, required) - `data` (list of DataPlan, required) ## Errors ### 401 Unauthorized Error Missing, invalid or revoked API key. Note: this envelope has no `status` field. - `message` (string, required) - `error` (string, required) ### 500 Internal Server Error Internal error - `status` (enum, required) - Allowed values: `error` - `message` (string, required) - `error` (string, optional) — Validator detail, present only on validation failures. ## Types ### DataPlan - `id` (integer, optional) — Internal row id — not used for purchase. - `plan_id` (string, optional, nullable) — Pass this as plan_id to /v1/data/purchase. Null plans cannot be bought through this API. - `network` (enum, optional) - Allowed values: `MTN`, `GLO`, `AIRTEL`, `9MOBILE` - `name` (string, optional) - `plan_name` (string, optional) - `price` (string, optional) — Naira, as a decimal string, priced for your account tier. - `validity` (string, optional) - `is_active` (boolean, optional) ## Examples **Response** ```json { "status": "success", "message": "Data plans fetched successfully", "data": [ { "id": 12, "plan_id": "mtn_1gb_30d", "network": "MTN", "name": "1GB", "plan_name": "MTN 1GB (SME)", "price": "270", "validity": "30 days", "is_active": true }, { "id": 13, "plan_id": "mtn_2gb_30d", "network": "MTN", "name": "2GB", "plan_name": "MTN 2GB (SME)", "price": "540", "validity": "30 days", "is_active": true }, { "id": 41, "plan_id": "glo_2.9gb_30d", "network": "GLO", "name": "2.9GB", "plan_name": "GLO 2.9GB", "price": "1300", "validity": "30 days", "is_active": true } ] } ``` **SDK Code** ```python import requests url = "https://api.vtuagent.com/v1/data/plans" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.vtuagent.com/v1/data/plans'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.vtuagent.com/v1/data/plans" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.vtuagent.com/v1/data/plans") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.vtuagent.com/v1/data/plans") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.vtuagent.com/v1/data/plans', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.vtuagent.com/v1/data/plans"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.vtuagent.com/v1/data/plans")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```