EmergingTextiles.com API Documentation

API Documentation

Version: 2.0 | Last Updated: May 2025

Overview

The EmergingTextiles.com API provides corporate subscribers with secure, programmatic access to comprehensive textile industry data spanning up to two decades of historical information. Our RESTful API delivers structured JSON responses containing market data, pricing information, production statistics, and industry trends.

This API is designed exclusively for corporate subscribers and offers enterprise-grade security, reliability, and performance. We provide you with ready-to-use endpoints for your specific data sets - no need to construct URLs or manage parameters.

Corporate Access Only: API access is reserved exclusively for corporate subscribers. Get your corporate subscription to access the API.

Authentication

The EmergingTextiles API uses API key authentication. Every request must include a valid API key in the request headers.

API Key Requirements

Your API key acts as a secure password and provides access to your authorized data sets. Each corporate subscriber receives personal API keys with specific permissions and endpoint access.

Header Format

Include your API key in the X-API-Key header with every request:

X-API-Key: your-api-key-here Content-Type: application/json
Security Notice: Keep your API key secure and never expose it in client-side code or public repositories. Treat it like a password.

Base URL

All API requests should be made to the following base URL:

https://api.emergingtextiles.com/api/sheets

All endpoints are served over HTTPS. HTTP requests will be rejected.

API Endpoints

We provide you with ready-to-use endpoints for your specific data sets. Each endpoint corresponds to a specific spreadsheet and sheet within your corporate subscription.

Endpoint Structure

Your endpoints are pre-built and provided to you in the format:

https://api.emergingtextiles.com/api/sheets/[SPREADSHEET-NAME]/[SHEET-NAME]

Example Endpoints

Typical endpoints you might receive:

https://api.emergingtextiles.com/api/sheets/yarn-production/monthly-data https://api.emergingtextiles.com/api/sheets/cotton-prices/historical-trends https://api.emergingtextiles.com/api/sheets/market-analysis/quarterly-reports

Data Retrieval

GET Each endpoint returns complete data from the specified sheet

Simply make a GET request to your provided endpoint - no additional parameters needed.

Endpoint Delivery: Your specific endpoints will be provided via email upon corporate subscription activation. Each endpoint is tailored to your data access requirements.

Request Format

Simple GET Request

Using your provided endpoint, make a simple GET request:

curl -X GET "https://api.emergingtextiles.com/api/sheets/yarn-production/monthly-data" \ -H "X-API-Key: your-api-key-here"

Alternative Endpoint Examples

# Cotton prices historical data curl -X GET "https://api.emergingtextiles.com/api/sheets/cotton-prices/historical-trends" \ -H "X-API-Key: your-api-key-here" # Market analysis quarterly reports curl -X GET "https://api.emergingtextiles.com/api/sheets/market-analysis/quarterly-reports" \ -H "X-API-Key: your-api-key-here"

Response Format

All API responses are returned in JSON format with a consistent structure.

Successful Response (200 OK)

{ "success": true, "data": [ ["Date", "Material", "Quantity", "Unit", "Region"], ["2025-05-27", "Cotton", "1250.75", "metric_tons", "Asia-Pacific"], ["2025-05-26", "Wool", "875.50", "metric_tons", "Europe"], ["2025-05-25", "Silk", "125.25", "metric_tons", "Asia"] ], "range": "Sheet1!A1:E100", "total_records": 4, "timestamp": "2025-05-27T14:39:11.489Z" }

Response Fields

Field Type Description
success boolean Indicates if the request was successful
data array Array of arrays containing the spreadsheet data
range string The range of data that was retrieved
total_records integer Total number of data rows returned
timestamp string ISO 8601 timestamp of the response

Error Handling

The API uses conventional HTTP response codes to indicate the success or failure of requests.

HTTP Status Codes

Status Code Meaning Description
200 OK Request successful
400 Bad Request Invalid request parameters
401 Unauthorized Invalid or missing API key
403 Forbidden API key lacks required permissions
404 Not Found Spreadsheet not found in registry
500 Internal Server Error Server error occurred

Error Response Format

{ "error": "Unauthorized", "message": "Invalid API key: API key not found or inactive", "timestamp": "2025-05-27T14:39:11.489Z" }

Code Examples

Click any code block to copy to clipboard:

JavaScript (Node.js)

const axios = require('axios'); const apiKey = 'your-api-key-here'; // Using your provided endpoint async function getYarnData() { try { const response = await axios.get('https://api.emergingtextiles.com/api/sheets/yarn-production/monthly-data', { headers: { 'X-API-Key': apiKey } }); console.log('Data:', response.data); return response.data; } catch (error) { console.error('Error:', error.response.data); } } getYarnData();

Python

import requests import json api_key = 'your-api-key-here' # Using your provided endpoint def get_yarn_data(): headers = { 'X-API-Key': api_key } endpoint = 'https://api.emergingtextiles.com/api/sheets/yarn-production/monthly-data' try: response = requests.get(endpoint, headers=headers) response.raise_for_status() data = response.json() print(json.dumps(data, indent=2)) return data except requests.exceptions.RequestException as e: print(f"Error: {e}") get_yarn_data()

PHP

<?php $apiKey = 'your-api-key-here'; // Using your provided endpoint function getYarnData($apiKey) { $endpoint = 'https://api.emergingtextiles.com/api/sheets/yarn-production/monthly-data'; $headers = [ 'X-API-Key: ' . $apiKey ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $endpoint); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode === 200) { $data = json_decode($response, true); print_r($data); return $data; } else { echo "Error: HTTP $httpCode\n"; echo $response; } } getYarnData($apiKey); ?>

Getting Started

Step 1: Get Corporate Subscription

API access is exclusive to corporate subscribers. Subscribe here to get started.

Step 2: Receive Your API Key & Endpoints

Once subscribed, you'll receive via email:

  • Your personal API key for authentication
  • Your specific endpoint URLs for each data set
  • Documentation for your available data

Step 3: Test Your Access

Start with a simple GET request using one of your provided endpoints:

curl -X GET "https://api.emergingtextiles.com/api/sheets/your-data-set/sheet-name" \ -H "X-API-Key: your-api-key-here"

Step 4: Integrate Into Your Applications

Use the code examples above to integrate your endpoints into your business applications, dashboards, or reporting systems.

Need Help? Contact our developer support team at api-support@emergingtextiles.com for assistance with integration or troubleshooting.