{"id":3577,"date":"2026-07-02T12:52:38","date_gmt":"2026-07-02T12:52:38","guid":{"rendered":"https:\/\/loadfocus.com\/blog\/?p=3577"},"modified":"2026-07-02T12:53:52","modified_gmt":"2026-07-02T12:53:52","slug":"import-curl-har-postman-openapi-to-load-tests","status":"publish","type":"post","link":"https:\/\/loadfocus.com\/blog\/2026\/07\/import-curl-har-postman-openapi-to-load-tests","title":{"rendered":"Turn cURL, HAR, Postman or OpenAPI into a k6 or JMeter Load Test"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes read<\/span><\/span>\n\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d2woeiihr4s5r6.cloudfront.net\/og\/load-testing-converters.jpg\" alt=\"Convert cURL, HAR, Postman and OpenAPI to k6 or JMeter load tests with LoadFocus\" width=\"1200\" height=\"630\" \/>\n\n<p class=\"lead\">Writing a load test script from scratch is the boring part. You already have the request you want to hammer: it is sitting in your browser&#8217;s network tab, in a Postman collection, or described in an OpenAPI spec. So why retype it as a k6 script or build a JMeter test plan by hand?<\/p>\n\n<p>Now you do not have to. LoadFocus converts a <strong>cURL<\/strong> command, a <strong>HAR<\/strong> file, a <strong>Postman<\/strong> collection or an <strong>OpenAPI<\/strong> spec into a runnable <strong>k6<\/strong> script or <strong>JMeter<\/strong> <code>.jmx<\/code> test plan. It works two ways: as free public tools you can use without an account, and built right into the New Test page so you can import, configure the load, and run in the cloud in one go.<\/p>\n\n<h2>What you can import<\/h2>\n<ul>\n  <li><strong>cURL<\/strong>: paste any <code>curl<\/code> command, including the &#8220;Copy as cURL&#8221; you grab from your browser&#8217;s network tab.<\/li>\n  <li><strong>HAR<\/strong>: an HTTP Archive exported from your browser&#8217;s dev tools. Static assets like images, CSS and fonts are filtered out automatically so the test focuses on real API calls.<\/li>\n  <li><strong>Postman<\/strong>: a collection exported as JSON. Collection variables are resolved where possible.<\/li>\n  <li><strong>OpenAPI<\/strong>: an OpenAPI or Swagger spec. Request bodies are generated from the schema when no example is provided.<\/li>\n<\/ul>\n\n<h2>Option 1: the free converters<\/h2>\n<p>No signup, nothing installed, all conversion happens in your browser. Pick your source and your target:<\/p>\n<ul>\n  <li>To <strong>k6<\/strong>: <a href=\"https:\/\/loadfocus.com\/curl-to-k6\">cURL to k6<\/a>, <a href=\"https:\/\/loadfocus.com\/har-to-k6\">HAR to k6<\/a>, <a href=\"https:\/\/loadfocus.com\/postman-to-k6\">Postman to k6<\/a>, <a href=\"https:\/\/loadfocus.com\/openapi-to-k6\">OpenAPI to k6<\/a><\/li>\n  <li>To <strong>JMeter<\/strong>: <a href=\"https:\/\/loadfocus.com\/curl-to-jmeter\">cURL to JMeter<\/a>, <a href=\"https:\/\/loadfocus.com\/har-to-jmeter\">HAR to JMeter<\/a>, <a href=\"https:\/\/loadfocus.com\/postman-to-jmeter\">Postman to JMeter<\/a>, <a href=\"https:\/\/loadfocus.com\/openapi-to-jmeter\">OpenAPI to JMeter<\/a><\/li>\n<\/ul>\n<p>Or start from the <a href=\"https:\/\/loadfocus.com\/load-testing-converters\">converters hub<\/a>. Copy the generated script, download it, or move straight into a cloud run.<\/p>\n\n<h2>Option 2: import inside LoadFocus and run in the cloud<\/h2>\n<p>On the <a href=\"https:\/\/loadfocus.com\/newk6test\">New k6 Test<\/a> or <a href=\"https:\/\/loadfocus.com\/newjmetertest\">New JMeter Test<\/a> page, expand the <strong>Import from cURL, HAR, Postman or OpenAPI<\/strong> panel. Paste your request or upload a file, click Import, and the generated script is attached to your test. Set your virtual users, duration and regions, then run it in the cloud.<\/p>\n\n<img decoding=\"async\" src=\"https:\/\/d2woeiihr4s5r6.cloudfront.net\/blog\/import-panel-k6.png\" alt=\"Importing a cURL request into a k6 load test on LoadFocus, with the generated script preview\" \/>\n\n<p>You can preview the generated script right there, and copy or download it if you want to refine it further.<\/p>\n\n<h2>Auth headers, handled<\/h2>\n<p>Real requests carry <code>Authorization<\/code>, <code>Cookie<\/code> or API-key headers. LoadFocus detects them and, by default, keeps their values in the generated script so the test authenticates on the first run. Prefer to keep secrets out of the script? Turn off &#8220;Include detected auth values&#8221; and they become placeholders (<code>__ENV<\/code> variables for k6, User Defined Variables for JMeter) that you fill in yourself.<\/p>\n\n<h2>A quick example<\/h2>\n<p>Paste a cURL command like this:<\/p>\n<pre><code>curl -X POST 'https:\/\/api.example.com\/v1\/login' \\\n  -H 'Content-Type: application\/json' \\\n  -H 'Authorization: Bearer your-token' \\\n  --data '{\"email\":\"user@example.com\",\"plan\":\"pro\"}'<\/code><\/pre>\n\n<p>and you get a ready-to-run k6 script:<\/p>\n<pre><code>import http from 'k6\/http';\nimport { check, group, sleep } from 'k6';\n\nexport const options = {\n  vus: 10,\n  duration: '30s',\n  thresholds: { http_req_failed: ['rate&lt;0.01'], http_req_duration: ['p(95)&lt;1000'] },\n};\n\nexport default function () {\n  group('POST https:\/\/api.example.com\/v1\/login', () =&gt; {\n    const res = http.post('https:\/\/api.example.com\/v1\/login',\n      '{\"email\":\"user@example.com\",\"plan\":\"pro\"}',\n      { headers: { 'Content-Type': 'application\/json', 'Authorization': 'Bearer your-token' } });\n    check(res, { 'status is 2xx': (r) =&gt; r.status &gt;= 200 &amp;&amp; r.status &lt; 300 });\n  });\n  sleep(1);\n}<\/code><\/pre>\n\n<p>Pick JMeter instead and you get a validated <code>.jmx<\/code> test plan built from the same request.<\/p>\n\n<h2>Try it<\/h2>\n<p>Grab a cURL command or a Postman collection you already have and convert it: <a href=\"https:\/\/loadfocus.com\/load-testing-converters\">loadfocus.com\/load-testing-converters<\/a>. Want to run it against real cloud load? <a href=\"https:\/\/loadfocus.com\/pricing\">Start free with LoadFocus<\/a>.<\/p>\n\n<p>More detail in the docs: <a href=\"https:\/\/loadfocus.com\/docs\/guides\/k6-load-testing\/import-to-k6-from-curl-har-postman-openapi\">Import to k6<\/a> and <a href=\"https:\/\/loadfocus.com\/docs\/guides\/jmeter-load-testing\/import-to-jmeter-from-curl-har-postman-openapi\">Import to JMeter<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes read<\/span><\/span>Writing a load test script from scratch is the boring part. You already have the request you want to hammer: it is sitting in your browser&#8217;s network tab, in a Postman collection, or described in an OpenAPI spec. So why retype it as a k6 script or build a JMeter test plan by hand? Now&#8230;  <a href=\"https:\/\/loadfocus.com\/blog\/2026\/07\/import-curl-har-postman-openapi-to-load-tests\" class=\"more-link\" title=\"Read Turn cURL, HAR, Postman or OpenAPI into a k6 or JMeter Load Test\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3579,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,103,9,48],"tags":[653,654,651,461,649,395,652,12,650],"class_list":["post-3577","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache-jmeter","category-integrations","category-load-testing","category-test-automation","tag-api-load-testing","tag-curl","tag-har","tag-jmeter","tag-k6","tag-load-testing","tag-openapi","tag-performance-testing-2","tag-postman"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/3577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/comments?post=3577"}],"version-history":[{"count":2,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/3577\/revisions"}],"predecessor-version":[{"id":3580,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/3577\/revisions\/3580"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media\/3579"}],"wp:attachment":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media?parent=3577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/categories?post=3577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/tags?post=3577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}