{"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><!-- pn-tldr --><h2>Key takeaways<\/h2><ul><li>Importing from cURL, HAR, Postman or OpenAPI skips the slowest part of writing a load test.<\/li><li>A HAR captures a real session including headers and order, which is hard to reproduce by hand.<\/li><li>Parameterise after import; a straight replay tests one user, not many.<\/li><\/ul><!-- \/pn-tldr -->\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<!-- pn-faq --><h2>Frequently Asked Questions<\/h2><h3>Why import rather than write the script?<\/h3><p>Because the request already exists in your browser&#8217;s network tab, a Postman collection or an OpenAPI spec. Retyping it is the slow part and the part where mistakes are introduced.<\/p><h3>What makes a HAR useful?<\/h3><p>It captures a real session: the headers, the order, the things you would not think to include. Reproducing that by hand is difficult and rarely accurate.<\/p><h3>Is the import ready to run as a load test?<\/h3><p>Not quite. Parameterise it first. A straight replay sends one user&#8217;s exact requests many times, which tests caching rather than the system.<\/p><!-- \/pn-faq --><!-- pn-related-reading --><h2>Related reading<\/h2><ul><li><a href=\"https:\/\/loadfocus.com\/blog\/2026\/06\/k6-vs-jmeter\">k6 vs JMeter: A Practical Load Testing Comparison<\/a><\/li><li><a href=\"https:\/\/loadfocus.com\/blog\/2026\/07\/data-driven-load-testing-scripts-complex-user-journeys\">Data-Driven Load Testing for Complex User Journeys<\/a><\/li><li><a href=\"https:\/\/loadfocus.com\/blog\/2020\/11\/record-jmeter-tests-chrome-extension\">Record JMeter Load Tests With a Chrome Extension<\/a><\/li><\/ul>","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>Key takeaways Importing from cURL, HAR, Postman or OpenAPI skips the slowest part of writing a load test. A HAR captures a real session including headers and order, which is hard to reproduce by hand. Parameterise after import; a straight replay tests one user, not many. Writing a load test script from scratch is the&#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,555],"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-cloud-testing","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}]}}